Listing values in excel

When we need to collect data from others, they may write different things from their perspective. Still, we need to make all the related stories under one. Also, it is common that while entering the data, they make mistakes because of typo errors. For example, assume in certain cells, if we ask users to enter either “YES” or “NO,” one will enter “Y,” someone will insert “YES” like this, and we may end up getting a different kind of results. So in such cases, creating a list of values as pre-determined values allows the users only to choose from the list instead of users entering their values. Therefore, in this article, we will show you how to create a list of values in Excel.

Table of contents
  • Create List in Excel
    • #1 – Create a Drop-Down List in Excel
    • #2 – Create List of Values from Cells
    • #3 – Create List through Named Manager
    • Things to Remember
    • Recommended Articles

You can download this Create List Excel Template here – Create List Excel Template

#1 – Create a Drop-Down List in Excel

We can create a drop-down list in Excel using the “Data Validation in excelThe data validation in excel helps control the kind of input entered by a user in the worksheet.read more” tool, so as the word itself says, data will be validated even before the user decides to enter. So, all the values that need to be entered are pre-validated by creating a drop-down list in Excel. For example, assume we need to allow the user to choose only “Agree” and “Not Agree,” so we will create a list of values in the drop-down list.

  • In the Excel worksheet under the “Data” tab, we have an option called “Data Validation” from this again, choose “Data Validation.”

Using Drop Down List 1

  • As a result, this will open the “Data Validation” tool window.

Using Drop Down List 1-1

  • The “Settings” tab will be shown by default, and now we need to create validation criteria. Since we are creating a list of values, choose “List” as the option from the “Allow” drop-down list.

Using Drop Down List 1-2

  • For this “List,” we can give a list of values to be validated in the following way, i.e., by directly entering the values in the “Source” list.

Using Drop Down List 1-3

  • Enter the first value as “Agree.”

Using Drop Down List 1-4

  • Once the first value to be validated is entered, we need to enter “comma” (,) as the list separator before entering the next value. So, enter “comma” and enter the following values as “Not Agree.”

Using Drop Down List 1-5

  • After that, click on “Ok,” and the list of values may appear in the form of the “drop-down” list.

Using Drop Down List 1-6

#2 – Create a List of Values from Cells

The above method is to get started, but imagine the scenario of creating a long list of values or your list of values changing now and then. Then, it may get difficult to return and edit the list of values manually. So, by entering values in the cell, we can easily create a list of values in Excel.

Follow the steps to create a list from cell values.

  1. We must first insert all the values in the cells.

    Create List Example 2

  2. Then, open “Data Validation” and choose the validation type as “List.”

    Create List Example 2-1

  3. Next, in the “Source” box, we need to place the cursor and select the list of values from the range of cells A1 to A5.

    Create List Example 2-3

  4. Click on “OK,” and we will have the list ready in cell C2.

    Create List Example 2-4
    So values to this list are supplied from the range of cells A1 to A5. Any changes in these referenced cells will also impact the drop-down list.

For example, in cell A4, we have a value as “Apr,” but now we will change that to “Jun” and see what happens in the drop-down list.

Create List Example 2-5

Now, look at the result of the drop-down list. Instead of “Apr,” we see “Jun” because we had given the list source as cell range, not manual entries.

#3 – Create List through Named Manager

There is another way to create a list of values, i.e., through named ranges in excelName range in Excel is a name given to a range for the future reference. To name a range, first select the range of data and then insert a table to the range, then put a name to the range from the name box on the left-hand side of the window.read more.

  • We have values from A1 to A5 in the above example, naming this range “Months.”

Create List Example 3

  • Now, select the cell where we need to create a list and open the drop-down list.

Create List Example 3-1

  • Now place the cursor in the “Source” box and press the F3 key to an open list of named ranges.

Create List Example 3-2

  • As we can see above, we have a list of names, choose the name “Months” and click on “OK” to get the name to the “Source” box.

Create List Example 3-3

  • Click on “OK,” and the drop-down list is ready.

Create List Example 3-4

Things to Remember

  • The shortcut key to open data validation is “ALT + A + V + V.
  • We must always create a list of values in the cells so that it may impact the drop-down list if any change happens in the referenced cells.

Recommended Articles

This article has been a guide to Excel Create List. Here, we learn how to create a list of values in Excel also, create a simple drop-down method and make a list through name manager along with examples and downloadable Excel templates. You may learn more about Excel from the following articles: –

  • Custom List in Excel
  • Drop Down List in Excel
  • Compare Two Lists in Excel
  • How to Randomize List in Excel?

Содержание

  1. How to get a list of unique and distinct values in Excel
  2. How to get unique values in Excel
  3. How to get distinct values in Excel (unique + 1 st duplicate occurrences)
  4. Extract distinct values in a column ignoring blank cells
  5. Get a list of distinct text values ignoring numbers and blanks
  6. How to extract case-sensitive distinct values in Excel
  7. How the unique / distinct formula works
  8. Extract distinct values from a column with Excel’s Advanced Filter
  9. Extract unique and distinct rows with Duplicate Remover
  10. Available downloads
  11. You may also be interested in

How to get a list of unique and distinct values in Excel

by Svetlana Cheusheva, updated on March 3, 2023

This is the final part of the Excel Unique Values series that shows how to get a list of distinct / unique values in column using a formula, and how to tweak that formula for different datasets. You will also learn how to quickly get a distinct list using Excel’s Advanced Filter, and how to extract unique rows with Duplicate Remover.

In a couple of recent articles, we discussed different methods to count and find unique values in Excel. If you had a chance to read those tutorials, you already know how to get a unique or distinct list by identifying, filtering, and copying. But that’s a bit long, and by far not the only, way to extract unique values in Excel. You can do it much faster by using a special formula, and in a moment I will show you this and a couple of other techniques.

Tip. To quickly get unique values in the latest version of Excel 365 that supports dynamic arrays, use the UNIQUE function.

How to get unique values in Excel

To avoid any confusion, first off, let’s agree on what we call unique values in Excel. Unique values are the values that exist in a list only once. For example:

To extract a list of unique values in Excel, use one of the following formulas.

Array unique values formula (completed by pressing Ctrl + Shift + Enter ):

=IFERROR(INDEX($A$2:$A$10, MATCH(0, COUNTIF($B$1:B1,$A$2:$A$10) + (COUNTIF($A$2:$A$10, $A$2:$A$10)<>1), 0)), «»)

Regular unique values formula (completed by pressing Enter):

=IFERROR(INDEX($A$2:$A$10, MATCH(0,INDEX(COUNTIF($B$1:B1, $A$2:$A$10)+(COUNTIF($A$2:$A$10, $A$2:$A$10)<>1),0,0), 0)), «»)

In the above formulas, the following references are used:

  • A2:A10 — the source list.
  • B1 — the top cell of the unique list minus 1. In this example, we start the unique list in B2, and therefore we supply B1 to the formula (B2-1=B1). If your unique list begins, say, in cell C3, then change $B$1:B1 to $C$2:C2.

Note. Because the formula references the cell above the first cell of the unique list, which is usually the column header (B1 in this example), make sure your header has a unique name that does not appear anywhere else in the column.

In this example, we are extracting unique names from column A (more precisely from range A2:A20), and the following screenshot demonstrates the array formula in action:

The detailed explanation of the formula’s logic is provided in a separate section, and here’s how to use the formula to extract unique values in your Excel worksheets:

  • Tweak one of the formulas according to your dataset.
  • Enter the formula in the first cell of the unique list (B2 in this example).
  • If you are using the array formula, press Ctrl + Shift + Enter . If you’ve opted for the regular formula, press the Enter key as usual.
  • Copy the formula down as far as needed by dragging the fill handle. Since both unique values formulas are we encapsulated in the IFERROR function, you can copy the formula up to the end of your table, and it won’t clutter your data with any errors no matter how few unique values have been extracted.

How to get distinct values in Excel (unique + 1 st duplicate occurrences)

As you may have already guessed from the heading of this section, distinct values in Excel are all different values in a list, i.e. unique values and first instances of duplicate values. For example:

To get a distinct list in Excel, use the following formulas.

Array distinct formula (requires pressing Ctrl + Shift + Enter ):

=IFERROR(INDEX($A$2:$A$10, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$10), 0)), «»)

Regular distinct formula:

=IFERROR(INDEX($A$2:$A$10, MATCH(0, INDEX(COUNTIF($B$1:B1, $A$2:$A$10), 0, 0), 0)), «»)

  • A2:A10 is the source list.
  • B1 is the cell above the first cell of the distinct list. In this example, the distinct list begins in cell B2 (it’s the first cell where you enter the formula), so you reference B1.

Extract distinct values in a column ignoring blank cells

If your source list contains any blank cells, the distinct formula we’ve just discussed would return a zero for each empty row, which might be a problem. To fix this, improve the formula a bit further:

Array formula to extract distinct values excluding blanks:

=IFERROR(INDEX($A$2:$A$10, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$10&»») + IF($A$2:$A$10=»»,1,0), 0)), «»)

Get a list of distinct text values ignoring numbers and blanks

In a similar manner, you can get a list of distinct values excluding empty cells and cells with numbers:

=IFERROR(INDEX($A$2:$A$10, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$10&»») + IF(ISTEXT($A$2:$A$10)=FALSE,1,0), 0)), «»)

As a quick reminder, in the above formulas, A2:A10 is the source list, and B1 is cell right above the first cell of the distinct list.

The following screenshot shows the result of both formulas:

When working with case-sensitive data such as passwords, user names or file names, you may need to get a list of case-sensitive distinct values. For this, use the following array formula, where A2:A10 is the source list, and B1 is the cell above the first cell of the distinct list:

Array formula to get case-sensitive distinct values (requires pressing Ctrl + Shift + Enter )

=IFERROR(INDEX($A$2:$A$10, MATCH(0, FREQUENCY(IF(EXACT($A$2:$A$10,TRANSPOSE($B$1:B1)), MATCH(ROW($A$2:$A$10), ROW($A$2:$A$10)), «»), MATCH(ROW($A$2:$A$10), ROW($A$2:$A$10))), 0)), «»)

How the unique / distinct formula works

This section is written especially for those curious and thoughtful Excel users who not only want to know the formula but fully understand its nuts and bolts.

It goes without saying that the formulas to extract unique and distinct values in Excel are neither trivial nor straightforward. But having a closer look, you may notice that all the formulas are based on the same approach — using INDEX/MATCH in combination with COUNTIF, or COUNTIF + IF functions.

For our in-depth analysis, let’s use the array formula that extracts a list of distinct values because all other formulas discussed in this tutorial are improvements or variations of this basic one:

=IFERROR(INDEX($A$2:$A$10, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$10), 0)), «»)

For starters, let’s cast away the obvious IFERROR function, which is used with a single purpose to eliminate #N/A errors when the number of cells where you’ve copied the formula exceeds the number of distinct values in the source list.

And now, let’s break down the core part of our distinct formula:

    COUNTIF(range, criteria) returns the number of cells within a range that meet a specified condition.

In this example, COUNTIF($B$1:B1, $A$2:$A$10) returns an array of 1’s and 0’s based on whether any of the values of the source list ($A$2:$A$10) appears somewhere in the distinct list ($B$1:B1). If the value is found, the formula returns 1, otherwise — 0.

In particular, in cell B2, COUNTIF($B$1:B1, $A$2:$A$10) becomes:

because none of the items of the source list (criteria) appears in the range where the function looks for a match. In this case, range ($B$1:B1) consists of a single item — «Distinct».
MATCH(lookup_value, lookup_array, [match_type]) returns the relative position of the lookup value in the array.
In this example, the lookup_value is 0, and consequently:

MATCH(0,COUNTIF($B$1:B1, $A$2:$A$10), 0)

because our MATCH function gets the first value that is exactly equal to the lookup value (as you remember, the lookup value is 0).
INDEX(array, row_num, [column_num]) returns a value in an array based on the specified row and (optionally) column numbers.

In this example, INDEX($A$2:$A$10, 1)

and returns «Ronnie».

When the formula is copied down the column, the distinct list ($B$1:B1) expands because the second cell reference (B1) is a relative reference that changes according to the relative position of the cell where the formula moves.

So, when copied to cell B3, COUNTIF($B$1:B1, $A$2:$A$10) changes to COUNTIF($B$1:B2, $A$2:$A$10), and becomes:

because one «Ronnie» is found in range $B$1:B2.

And then, MATCH(0,<1;0;0;0;0;0;0;0;0>,0) returns 2, because 2 is the relative position of the first 0 in the array.

And finally, INDEX($A$2:$A$10, 2) returns the value from the 2 nd row, which is «David».

Tip. For better understanding of the formula’s logic, you can select different parts of the formula in the formula bar and press F9 to see what a selected part evaluates to:

If you still have difficulties figuring out the formula, you can check out the following tutorial for the detailed explanation of how the INDEX/MATCH liaison works: INDEX & MATCH as a better alternative to Excel VLOOKUP.

As already mentioned, the other formulas discussed in this tutorial are based on the same logic, with just a few modifications:

Unique values formula — contains one more COUNTIF function that excludes from the unique list all items that appear in the source list more than once: COUNTIF($A$2:$A$10, $A$2:$A$10)<>1 .

Distinct values formula ignoring blanks — here you add an IF function that prevents blank cells from being added to the distinct list: IF($A$2:$A$13=»»,1,0) .

Distinct text values formula ignoring numbers — you use the ISTEXT function to check whether a value is text, and the IF function to dismiss all other value types, including blank cells: IF(ISTEXT($A$2:$A$13)=FALSE,1,0) .

Extract distinct values from a column with Excel’s Advanced Filter

If you don’t want to waste time on figuring out the arcane twists of the distinct value formulas, you can quickly get a list of distinct values by using the Advanced Filter. The detailed steps follow below.

  1. Select the column of data from which you want to extract distinct values.
  2. Switch to the Data tab >Sort & Filter group, and click the Advanced button:
  3. In the Advanced Filter dialog box, select the following options:
    • Check Copy to another location radio button.
    • In the List range box, verify that the source range is displayed correctly.
    • In the Copy to box, enter the topmost cell of the destination range. Please keep in mind that you can copy the filtered data only to the active sheet.
    • Select the Unique records only

  • Finally, click the OK button and check the result:
  • Please pay attention that although the Advanced Filter’s option is named «Unique records only«, it extracts distinct values, i.e. unique values and 1 st occurrences of duplicate values.

    Extract unique and distinct rows with Duplicate Remover

    In the final part of this tutorial, let me show you our own solution to find and extract distinct and unique values in Excel sheets. This solution combines the versatility of Excel formulas and simplicity of the advanced filter. In addition, it provides a couple of unique features such as:

    • Find and extract unique / distinct rows based on values in one or more columns.
    • Find, highlight, and copy unique values to any other location, in the same or different workbook.

    And now, let’s see the Duplicate Remover tool in action.

    Supposing you have a summary table created by consolidating data from several other tables. Obviously, that summary table contains a lot of duplicate rows and your task is to extract unique rows that appear in the table only once, or distinct rows including unique and 1 st duplicate occurrences. Either way, with the Duplicate Remover add-in the job is done in 5 quick steps.

      Select any cell within your source table and click the Duplicate Remover button on the Ablebits Data tab, in the Dedupe group.

    The Duplicate Remover wizard will run and select the entire table. So, just click Next to proceed to the next step.

  • Select the value type you want to find, and click Next:
    • Unique
    • Unique +1 st occurrences (distinct)

    In this example, we aim to extract unique rows that appear in the source table only once, so we select the Unique option:

    Tip. As you can see in the above screenshot, there are also 2 options for duplicate values, just keep it in mind if you need to dedupe some other worksheet.

    In this example, we want to find unique rows based on values in all 3 columns (Order number, First name and Last name), therefore we select all.

  • Choose the action to perform on the found unique values. The following options are available to you:
    • Highlight unique values
    • Select unique values
    • Identify in a status column
    • Copy to another location

    Because we are extracting unique rows, select Copy to another location, and then specify where exactly you want to copy them — active sheet (select the Custom location option, and specify the top cell of the destination range), new worksheet or new workbook.

    In this example, let’s opt for the new sheet:

  • Click the Finish button, and you are done!
  • Liked this quick and simple way to get a list of unique values or rows in Excel? If so, I encourage you to download an evaluation version below and give it a try. Duplicate Remover as well as all other time-saving tools that we have are included with Ultimate Suite for Excel.

    Available downloads

    You may also be interested in

    Table of contents

    How to count distinct value in a row ?
    For e.g
    Column1 Column2 Column3 Column4 Count of Distinct country
    USA INDIA UK UK 3
    USA USA USA USA 0
    UK FRANCE UAE PERU 4

    Thank you Svetlana and all others commenting on this excel topic. May I ask how functions would differ if we were attempting to do the same with multiple rows?

    In the example above for ignoring blanks, but allowing for numbers. I modified the table to include original Names column and added Names2. I’m allowing for numbers since my dataset/table has numbers. The function I thought would work is as follows:

    Columns A and B are Names and Names2 respectively. How would I go about doing multiple columns? What if columns weren’t side-by-side?

    Thank you ahead of time. AZ

    multiple columns. not rows. My apologies.

    Hello!
    Here is a formula that will find all distinct values (text and numbers) in two columns A and B ignoring blanks. Write it in D2 and copy it down the column.

    =IFERROR(IFERROR(INDEX($A$2:$A$20, MATCH(0,COUNTIF($D$1:D1,$A$2:$A$20)+($A$2:$A$20=»»),0)), INDEX($B$2:$B$20, MATCH(0,COUNTIF($D$1:D1,$B$2:$B$20)+($B$2:$B$20=»»),0))),»»)

    I hope my advice will help you solve your task.

    That seems to have worked. A step closer to counting unique values from multiple columns. As I count additional columns I’ll keep increasing the function. By the time all is said and done I’ll have over 100 columns to count. A tad bit primitive but It’s a solution for the meantime until I transition to another development environment such as Python.

    Thanks for the help!

    Perhaps I declared victory too soon. I was hoping to extrapolate from the «2 column» example of acquiring unique values to go from 2 to 3 to 4 and so on and so forth, but running into some difficulties that perhaps you can assist with.

    To recap, and this is more for my understanding since I’m a getting all tangled up with this not so intuitive excel function. We started with one column which seemed to work.

    The two column function was as follows:

    =IFERROR(IFERROR(
    INDEX($A$2:$A$20, MATCH(0,COUNTIF($D$1:D1,$A$2:$A$20)+($A$2:$A$20=»»),0)),
    INDEX($B$2:$B$20, MATCH(0,COUNTIF($D$1:D1,$B$2:$B$20)+($B$2:$B$20=»»),0))),»»)

    Moving on to three columns is failing and not sure why. What am I doing wrong?

    =IFERROR(IFERROR(IFERROR(
    INDEX($A$2:$A$20, MATCH(0,COUNTIF($D$1:D1,$A$2:$A$20)+($A$2:$A$20=»»),0)),
    INDEX($B$2:$B$20, MATCH(0,COUNTIF($D$1:D1,$B$2:$B$20)+($B$2:$B$20=»»),0)),
    INDEX($C$2:$C$20, MATCH(0,COUNTIF($D$1:D1,$C$2:$C$20)+($C$2:$C$20=»»),0))
    )),»»)

    I’m adding white space for better visualization. Thanks for the help.

    Hello!
    Here is an array formula that finds distinct values in three columns –

    =IFERROR(IFERROR(IFERROR(INDEX($A$2:$A$20,MATCH(0,COUNTIF($D$1:D1,$A$2:$A$20)+($A$2:$A$20=»»),0)), INDEX($B$2:$B$20,MATCH(0,COUNTIF($D$1:D1,$B$2:$B$20)+($B$2:$B$20=»»),0))), INDEX($C$2:$C$20,MATCH(0,COUNTIF($D$1:D1,$C$2:$C$20)+($C$2:$C$20=»»),0))),»»)

    Hope this is what you need.

    How would I get a unique minimum value in row F

    R0 A B C D E Unique Minimum
    R1 1 2 3 4 5 1
    R2 2 3 4 5 6 2
    R3 2 3 6 8 9 3 — because 2 is already in place in R2

    Over 1 thousand rows to check

    Hi!
    You can solve your problem with a VBA macro.

    What if there is a criteria which then only trigger the list of unique values formula?
    For instances, given the following example, what formula should I include if I want to get all of the «B»‘s unique number as a criteria to be reflected in the column beside from the list of data?

    Column A Column B
    A 200
    B 400
    A 200
    A 100
    B 400
    B 100
    C 600
    B 100
    B 400
    C 200

    Hi!
    Have you tried the ways described in this blog post? If they don’t work for you, then please describe your task in detail, I’ll try to suggest a solution.

    Yes, I have tried the ways described in this blog post (only involves formula). But I could not get the results that I was hoping for.

    As per the given example previously, in Column A which I only want the unique number for «B» in Column B to be reflected in a new column, I’ve tried to input the the following formula:-

    =IF(MATCH(«B»,$A$10,0)=»B»,IFERROR(INDEX($B$2:$B$10, MATCH(0, COUNTIF($C$1:C1, $B$2:$B$10&»») + IF($B$2:$B$10=»»,1,0), 0)), «»),»»)

    But the results came back with an error.

    The results that I’m looking for would be 100 and 400 in the new column.

    Hello!
    If you want to get a list of unique values by condition, I recommend reading this guide with examples: Get a list of unique values based on criteria.
    This should solve your task.

    From my understanding, FILTER and UNIQUE function only appears for Excel 365 and Excel 2021.

    The problem is that I’m currently running my spreadsheets on Excel 2019 which does not include any of this functions. Therefore, I’ve tried with the alternative which was the formula provided from this section.

    Hello!
    If you write the condition in cell E2, and write the array formula in F2 —

    Press Ctrl + Shift + Enter so that array formula works.
    After that you can copy this formula down along the column.
    Hope this is what you need.

    Yes! This is what I was looking for.
    Thank you so much, this helps me a bunch!

    Thanks a lot! It helps

    Small update to my question

    I am trying just something very simple as table:
    Just 2 columns: Names | UNIQUE
    In the column Names we have «texts» as below
    00340312891320582291
    00340312891920067756
    00340312891920069262
    00340312891320580598
    00340312891320578410
    00340312891320578189
    00340312891320578854
    00340312891320577890
    00340312891320578231
    00340312891320577661
    In the column UNIQUE — should appear only unique values, in this example everything is unique but to compare it it must be as text not numbers like all the time.
    Ignore please concatenate in my message before, its just trying to find a way. I clearly use your description and it not works for this example — only when I add prefix as letter or something 🙁
    Help please — from one column to another just unique, especially if it can works with Table — area defined as table

    Hello!
    If I understand correctly, you want to keep leading zeros in numbers. An easy way to preserve leading zeros in Excel is to precede the number with an apostrophe (‘). For example, instead of entering 0034, enter ‘0034.
    Without this, Excel will ignore leading zeros and will convert your text to a number.
    The following tutorial should help: How to keep leading zeros in Excel.

    Hello,
    thank you for good advice in Distinct extraction problem, but cannot find a solution with probably bug in Excel. It is about specific text values which actually looks like numbers — but it isn’t.

    For example I have column names as below (all of it is text, not numbers, without ‘ ):
    Names
    00340312891320582291
    00340312891920067756
    00340312891920069262
    00340312891320580598
    00340312891320578410
    00340312891320578189
    00340312891320578854
    00340312891320577890
    00340312891320578231
    00340312891320577661

    when I use formula (normal or array) as in your example above:
    =IFERROR(INDEX(CONCATENATE($A$2:$A$10),MATCH(0,COUNTIF($B$1:B1,$A$2:$A$10),0)),»»)
    it skip many values — taking it as numbers I think. Result is:

    Distinct
    00340312891320582291
    00340312891920067756
    00340312891920069262
    00340312891320580598
    00340312891320578410
    00340312891320577890

    but all of my input data is unique so how can it be? I just want to take it all as text or numbers — probably excel change it in this formula to the scientific format and some numbers after transformation is the same. This is what I think, excel used here to compare and give bad result:
    Names
    340312891320582000
    340312891920067000
    340312891920069000
    340312891320580000
    340312891320578000
    340312891320578000
    340312891320578000
    340312891320577000
    340312891320578000
    340312891320577000

    and in this compare result is like above — just 6 «Names» appear rest of them is the same, all because of scientific format used here to compare not as a texts. Problem disappear when my input is with any letter as prefix (like: «a00340312891320582291»). So it is no more number (probably too long for amateur windows software) and its okay, I have 10 results as a source, nothing disappear.

    I am really confused how to skip it, just compare text to text as it is not a numbers

    Why up to the office version 2021 this problem is not resolved, there is really no function to extract it easy — not pivot table, I know it can be and okay, but I don’t want make to many temporary references. Just normal function — take from one range, unique values to another range. The best is normal Table defined by Control+T and using columns names not range like [Names] or [Distinct].

    Is it any way possible?

    Regarding my SORT question, I found that even using the manual sorting functions in Excel also do nothing to the unique column, which is presumably why the SORT function doesn’t work. I suspect sorting these cells that have the formula still results in the finding of the unique data list in its original order. My compromise is to write the SORT in the adjacent column which works.

    Another solution is to sort the data before using the unique extraction.

    Great teaching. Thanks.

    I’d like to get the unique alphabetically sorted.

    Using Excel 365’s SORT function in various places in the first formula you show, I can’t get SORT to do anything.

    Is that because the SORT function has to happen after the list is extracted, and there is no way to set the order of the functions?

    Regarding trying to use the SORT function combined with the unique lost process:

    I tried just a manual Sort on the unique column, but nothing seemed to happen. It’s possible it did soft the formula cells but it returned with the same list, first found-last found. Probably because it is going back to the data and finding it again in the same order.

    FILTER function wouldn’t help with this unique formula as there is nothing to filter until it is all done. (I assume.)

    So, I could sort the source data. But will just continue with a helped column where the SORT function sorts the unique list. Easier since it is now programmed in, no macros needed.

    I am trying to apply this to a book inventory list for my library.
    I’d like to setup a unique list in one column with the number of copies for every book we have in the inventory. Currently our system only shows us the overall total of books, but not how many of each copy we have, so we have several copies within our database but would need to manually count them in excel which simply isn’t efficient. I was toying a bit with the built in advanced function earlier and it works to some degree, however, I did notice that when expanding this to have multiple criteria’s to watch out for, it would count some of the items in the list twice and the overall total would be off. The sheet I’m working with has 1187 total entries, but the advanced formula using unique title and author has a result of 1211 total entries.

    Hello!
    I don’t know what formula you used. I recommend checking out this guide: Count unique values with criteria.
    If this is not what you want, please provide more details about your problem.

    Источник

    Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel Starter 2010 More…Less

    When you want to display a list of values that users can choose from, add a list box to your worksheet.

    Sample list box

    Add a list box to a worksheet

    1. Create a list of items that you want to displayed in your list box like in this picture.

      value list for use in combo box

    2. Click Developer > Insert.

      Note: If the Developer tab isn’t visible, click File > Options > Customize Ribbon. In the Main Tabs list, check the Developer box, and then click OK.

    3. Under Form Controls, click List box (Form Control).

      the list box form control button

    4. Click the cell where you want to create the list box.

    5. Click Properties > Control and set the required properties:

      Proprties for the list box control.

      • In the Input range box, type the range of cells containing the values list.

        Note: If you want more items displayed in the list box, you can change the font size of text in the list.

      • In the Cell link box, type a cell reference.

        Tip: The cell you choose will have a number associated with the item selected in your list box, and you can use that number in a formula to return the actual item from the input range.

      • Under Selection type, pick a Single and click OK.

        Note: If you want to use Multi or Extend, consider using an ActiveX list box control.

    Add a combo box to a worksheet

    You can make data entry easier by letting users choose a value from a combo box. A combo box combines a text box with a list box to create a drop-down list.

    Combo box

    You can add a Form Control or an ActiveX Control combo box. If you want to create a combo box that enables the user to edit the text in the text box, consider using the ActiveX Combo Box. The ActiveX Control combo box is more versatile because, you can change font properties to make the text easier to read on a zoomed worksheet and use programming to make it appear in cells that contain a data validation list.

    1. Pick a column that you can hide on the worksheet and create a list by typing one value per cell.

      value list for use in combo box

      Note: You can also create the list on another worksheet in the same workbook.

    2. Click Developer > Insert.

      Note: If the Developer tab isn’t visible, click File > Options > Customize Ribbon. In the Main Tabs list, check the Developer box, and then click OK.

    3. Pick the type of combo box you want to add:

      • Under Form Controls, click Combo box (Form Control).

        Or

      • Under ActiveX Controls, click Combo Box (ActiveX Control).

        Insert combo box

    4. Click the cell where you want to add the combo box and drag to draw it.

    Tips: 

    • To resize the box, point to one of the resize handles, and drag the edge of the control until it reaches the height or width you want.

    • To move a combo box to another worksheet location, select the box and drag it to another location.

    Format a Form Control combo box

    1. Right-click the combo box and pick Format Control.

    2. Click Control and set the following options:

      Format control dialog box

      • Input range: Type the range of cells containing the list of items.

      • Cell link: The combo box can be linked to a cell where the item number is displayed when you select an item from the list. Type the cell number where you want the item number displayed.

        For example, cell C1 displays 3 when the item Sorbet is selected, because it’s the third item in our list.

        Linked cell shows item number when item is selected.

        Tip: You can use the INDEX function to show an item name instead of a number. In our example, the combo box is linked to cell B1 and the cell range for the list is A1:A2. If the following formula, is typed into cell C1: =INDEX(A1:A5,B1), when we select the item «Sorbet» is displayed in C1.

        Enter formula to show item from linked cell

      • Drop-down lines: The number of lines you want displayed when the down arrow is clicked. For example, if your list has 10 items and you don’t want to scroll you can change the default number to 10. If you type a number that’s less than the number of items in your list, a scroll bar is displayed.

        Scroll bar is displayed.

    3. Click OK.

    Format an ActiveX combo box

    1. Click Developer > Design Mode.

    2. Right-click the combo box and pick Properties, click Alphabetic, and change any property setting that you want.

      Here’s how to set properties for the combo box in this picture:

      Example of a combo box.

      Property settings for ActiveX combo box.

      To set this property

      Do this

      Fill color

      Click BackColor > the down arrow > Pallet, and then pick a color.

      Color fill property for a combo box.

      Font type, style or size

      Click Font > the button and pick font type, size, or style.

      Setting for fonts in text box

      Font color

      Click ForeColor > the down arrow > Pallet, and then pick a color.

      Link a cell to display selected list value.

      Click LinkedCell

      Link Combo Box to a list

      Click the box next to ListFillRange and type the cell range for the list.

      Change the number of list items displayed

      Click the ListRows box and type the number of items to be displayed.

    3. Close the Property box and click Designer Mode.

    4. After you complete the formatting, you can right-click the column that has the list and pick Hide.

    Need more help?

    You can always ask an expert in the Excel Tech Community or get support in the Answers community.

    See Also

    Overview of forms, Form controls, and ActiveX controls on a worksheet

    Add a check box or option button (Form controls)

    Need more help?

    Post Banner 2@2x.png

    There are many scenarios you may come across while working in Excel where you only desire unique values in a list. You might want to rid your data of duplicates to create summaries, populate drop-down lists, or remove duplicates that found their way into your spreadsheet.

    Luckily, Microsoft Excel offers many ways to accomplish summarizing values into a unique listing and depending on your particular situation, you may use different methods to accomplish the task at hand.

    In this article, we’ll cover a bunch of different ways to identify those unique values so you have a full set of tactics to handle anything thrown your way. Let’s dive in!

    1. Use The UNIQUE Function

    With the release of Dynamic Array functions in 2020, Excel now offers a powerful function right out of the box to provide a simple way to pull together a list of unique values. Simply input the range you would like to analyze inside the UNIQUE Function and you’ll have the unique results delivered in a Spill Range below the formula.

    Unique Function.png

    If you’re looking for a more long-term solution, convert your data set into an Excel Table (ctrl + t) and point your UNIQUE function to read the table column. This will allow you to always have a more dynamic listing as your data grows or shrinks over time.

    Unique function with table.png

    Pro Tip: If you want your list in alphabetical order add the Sort Function to your formula:

    =SORT(UNIQUE(Table1[State]))

    2. Use An Array Formula

    Before the UNIQUE function was released, Excel users were left using more complex methods to compile a list of unique values from a range. Pretty much all of these methods involved using array formulas (think Ctrl+Shift+Enter) to output the end result. The formula I will share in this post does not require keying in Ctrl+Shift+Enter to activate it, hence why I prefer it. The downside to using an Array formula over an Dynamic Array function is you have to carry it down manually, there is no Spill Range functionality that will automatically resize your list.

    I won’t go into the details of how this formula works (if interested go here), just know if you set it up properly it will magically work. Make sure you pay close attention to your dollar signs at the beginning of the COUNTIF function. It does matter that the first cell reference stays static while the other one changes as you carry the formula down (ie $G$3:G3 in the below example).

    Finally, after you setup the first formula, you’ll need to drag the formula down until you start seeing #N/As. You’ll want to monitor your list if your data will be changing in the future to ensure it is picking up all the unique results. As a rule, I always make note to ensure at least one #N/A is showing at the bottom of my list.

    Lookup Formula.png

    FORMULA: =LOOKUP(2,1/(COUNTIF($G$3:G3,$B$3:$B$12)=0),$B$3:$B$12)

    3. Apply A Filter

    If you would like to see a list of unique values without necessarily needing to store the list, you can utilize a cell Filter (ctrl + shift + L). Apply a filter to your data and click the filter arrow to see a list showing all the unique values within that particular column of data.

    Filter.png

    4. Pivot Table

    A Pivot Table is another good way to list out unique values. Select your data range (ensuring every column has a unique header value) and go to Insert > Pivot Table. When the Insert Dialog box appears , simply hit the OK button and you can start pivoting your data.

    Drag the name of the column you would like to see a unique list of value for into the “Rows” quadrant. You should instantly see your list populate within the Pivot Table.

    5. Remove Duplicates

    If you actually want to modify your data so it only has unique values, you can utilize Excel’s Remove Duplicate button. This feature can be used on a range of cells or within an Excel Table.

    Remove Dups 1.png

    Follow these steps to utilize this functionality:

    1. Select your range of data

    2. Navigate to the Data Ribbon tab.

    3. Click the Remove Duplicates button within the Data Tools button group

    4. Check the combination of columns you’d like to be unique

    Remove Dups 2.png

    6. Highlight Duplicates With Conditional Formatting

    You may run into situations where you want to quickly visualize if there are any duplicates in your data set. This is where you can apply a little bit of conditional formatting and luckily there is a preset to flag duplicate values!

    Highlight Dups 1.png

    Just follow these simple steps:

    1. Highlight the cell range you want to analyze

    2. Navigate to the Conditional Formatting button on the Home tab

    3. Select Highlight Cells Rules

    4. Select Duplicate Values…

    5. Click OK

    7. Use A Counting Formula

    You might want to pursue utilizing a formula to flag your duplicate values. This can be done by using the COUNTIF() function. The below example shows how you can analyze each cell in the data range and understand if that value occurs more than once. If you have any count that is great than 1, you know there’s a duplicate within your data set.

    Example Formula: =COUNTIF($D$4:$D$13, D4)

    After you have implemented the formula, simply apply a filter and filter out all the “1” values.

    Formula Dups.png

    If you are more concerned with having a duplicate row across multiple columns, you can add a helper column (Column D in the below example) that joins the values of the columns you want to ensure are unique. After the helper column is created, point your COUNTIF function to it and repeat the steps in the prior example.

    Formula Dups2.png

    Any Others I Missed?

    Whew, that was a lot of techniques we went through to get to pretty much the same result. Hopefully, you start to realize as you find yourself needing to pull together a list of unique values, how valuable knowing all the options available to you in Excel. I’m sure there were other great methods that I overlooked or haven’t discovered yet. Please let me know if you have any tips in the comments section and I can growth this article even further!

    I Hope This Helped!

    Hopefully, I was able to explain how you can use a variety of methods to create unique lists of your data. If you have any questions about this technique or suggestions on how to improve it, please let me know in the comments section below.

    Chris Newman 2020 - TheSpreadsheetGuru

    About The Author

    Hey there! I’m Chris and I run TheSpreadsheetGuru website in my spare time. By day, I’m actually a finance professional who relies on Microsoft Excel quite heavily in the corporate world. I love taking the things I learn in the “real world” and sharing them with everyone here on this site so that you too can become a spreadsheet guru at your company.

    Through my years in the corporate world, I’ve been able to pick up on opportunities to make working with Excel better and have built a variety of Excel add-ins, from inserting tickmark symbols to automating copy/pasting from Excel to PowerPoint. If you’d like to keep up to date with the latest Excel news and directly get emailed the most meaningful Excel tips I’ve learned over the years, you can sign up for my free newsletters. I hope I was able to provide you some value today and hope to see you back here soon! — Chris

    Microsoft Excel’s list function allows you to display several different values in a single cell using the form of a drop-down menu. When you activate the menu, you can view all of the values in the list. While the lists can be used as a space-saving convenience, they’re also useful in Excel forms when you want to make data entry easier or limit users to specific entries. You can populate your list with text, numbers or even formulas.

    1. Open the worksheet where you want to create the list, and then open a new worksheet by clicking the «+» or the new worksheet icon at the bottom of the window.

    2. Enter the values you want displayed in the list. The values should be in a single row or column on the new worksheet. Return to the original worksheet, and select the cell that will contain the list.

    3. Select the «Data» tab, and then click «Data Validation» in the Data Tools section of the ribbon. The Data Validation dialog box appears.

    4. Click the drop-down button next to «Allow,» and select «List» from the options. Make sure the box next to «In-cell Drop-down» is checked.

    5. Click inside the «Source» field, and then switch to the worksheet containing the list values.

    6. Select the range of cells containing the values. As you select the cells, the cell addresses automatically populate the «Source» field in the dialog box.

    7. Click «OK» in the dialog box to create the list. Excel returns the focus to the original worksheet, and the cell containing the list has a new drop-down button. Click the button to view the list and select one of the values.

    So, there are times when you would like to know that a value is in a list or not. We have done this using VLOOKUP. But we can do the same thing using COUNTIF function too. So in this article, we will learn how to check if a values is in a list or not using various ways.

    Check If Value In Range Using COUNTIF Function

    So as we know, using COUNTIF function in excel we can know how many times a specific value occurs in a range. So if we count for a specific value in a range and its greater than zero, it would mean that it is in the range. Isn’t it?

    Generic Formula

    =COUNTIF(range,value)>0

    Range: The range in which you want to check if the value exist in range or not.

    Value: The value that you want to check in the range.

    Let’s see an example:

    Excel Find Value is in Range Example

    For this example, we have below sample data. We need a check-in the cell D2, if the given item in C2 exists in range A2:A9 or say item list. If it’s there then, print TRUE else FALSE.
    1
    Write this formula in cell D2:

    2
    Since C2 contains “scale” and it’s not in the item list, it shows FALSE. Exactly as we wanted. Now if you replace “scale” with “Pencil” in the formula above, it’ll show TRUE.
    3
    Now, this TRUE and FALSE looks very back and white. How about customizing the output. I mean, how about we show, “found” or “not found” when value is in list and when it is not respectively.
    Since this test gives us TRUE and FALSE, we can use it with IF function of excel.

    Write this formula:

    =IF(COUNTIF(A2:A9,C2)>0,»in List»,»Not in List»)

    You will have this as your output.
    4
    What If you remove “>0” from this if formula?

    =IF(COUNTIF(A2:A9,C2),»in List»,»Not in List»)

    It will work fine. You will have same result as above. Why? Because IF function in excel treats any value greater than 0 as TRUE.

    How to check if a value is in Range with Wild Card Operators

    Sometimes you would want to know if there is any match of your item in the list or not. I mean when you don’t want an exact match but any match.

    For example, if in the above-given list, you want to check if there is anything with “red”. To do so, write this formula.

    =IF(COUNTIF(A2:A9,»*red*»),»in List»,»Not in List»)

    This will return a TRUE since we have “red pen” in our list. If you replace red with pink it will return FALSE. Try it.
    Now here I have hardcoded the value in list but if your value is in a cell, say in our favourite cell B2 then write this formula.

    IF(COUNTIF(A2:A9,»*»&B2&»*»),»in List»,»Not in List»)

    5
    There’s one more way to do the same. We can use the MATCH function in excel to check if the column contains a value. Let’s see how.

    Find if a Value is in a List Using MATCH Function

    So as we all know that MATCH function in excel returns the index of a value if found, else returns #N/A error. So we can use the ISNUMBER to check if the function returns a number.
    If it returns a number ISNUMBER will show TRUE, which means it’s found else FALSE, and you know what that means.

    Write this formula in cell C2:

    =ISNUMBER(MATCH(C2,A2:A9,0))

    6
    The MATCH function looks for an exact match of value in cell C2 in range A2:A9. Since DESK is on the list, it shows a TRUE value and FALSE for SCALE.

    So yeah, these are the ways, using which you can find if a value is in the list or not and then take action on them as you like using IF function. I explained how to find value in a range in the best way possible. Let me know if you have any thoughts. The comments section is all yours.

    Related Articles:

    How to Check If Cell Contains Specific Text in Excel

    How to Check A list of Texts In String in Excel

    How to take the Average Difference between lists in Excel

    How to Get Every Nth Value From A list in Excel

    Popular Articles:

    50 Excel Shortcuts to Increase Your Productivity

    How to use the VLOOKUP Function in Excel

    How to use the COUNTIF function in Excel

    How to use the SUMIF Function in Excel


    Download Article


    Download Article

    If you’re wondering how to create a multiple-line list in a single cell in Microsoft Excel, you’ve come to the right place. Whether you want a cell to contain a bulleted list with line breaks, a numbered list, or a drop-down list, inserting a list is easy once you know where to look. This wikiHow will teach you three helpful ways to insert any type of list to one cell in Excel.

    1. Image titled Make a List Within a Cell in Excel Step 1

      1

      Double-click the cell you want to edit. If you want to create a bullet or numerical list in a single cell with each item on its own line, start by double-clicking the cell into which you want to type the list.

    2. Image titled Make a List Within a Cell in Excel Step 2

      2

      Insert a bullet point (optional). If you want to preface each list item with a bullet rather than a number or other character, you can use a key shortcut to insert the bullet symbol. Here’s how:

      • Mac: Press Option + 8.
      • Windows:

        • If you have a numeric keypad on the side of your keyboard, hold down the Alt key while pressing 7 on the keypad.[1]
        • If not, click the Insert menu, select Symbol, type 2022 into the «Character code» box at the bottom, and then click Insert.
        • If 2022 didn’t bring up a bullet point, select the Wingdings font instead, and then enter 159 as the character code. You can then click Insert to add the bullet point.

      Advertisement

    3. Image titled Make a List Within a Cell in Excel Step 3

      3

      Type your first list item. Don’t press Enter or Return after typing.

      • If you want your list to be numbered, preface the first list item with 1. or 1).
    4. Image titled Make a List Within a Cell in Excel Step 4

      4

      Press Alt+ Enter (PC) or Control+ Option+ Return on a Mac. This adds a line break so you can start typing on the next line of the same cell.[2]

    5. Image titled Make a List Within a Cell in Excel Step 5

      5

      Type the remaining list items. To continue your list, just enter another bullet point on the second line, type the list item, and press Alt + Enter or Control + Option + Return to open a new line. When you’re finished, you can click anywhere else on your sheet to exit the cell.

    6. Advertisement

    1. Image titled Make a List Within a Cell in Excel Step 6

      1

      Create your list in another app. If you’re trying to paste a bullet list (or other type of list) into a single cell rather than have it spread across multiple cells, there’s a trick to pasting the list. Start by creating your list in an app like Word, TextEdit, or Notepad.

      • If you create a bulleted list in Word, the bullets will copy over to your cell when pasted into Excel. Bullets may not copy from other apps.
    2. Image titled Make a List Within a Cell in Excel Step 7

      2

      Copy the list. To do this, just highlight the list, right-click the highlighted area, and then select Copy.

    3. Image titled Make a List Within a Cell in Excel Step 8

      3

      Double-click a cell in Excel. Double-clicking the cell before pasting makes it so the list items will all appear in the same cell.

    4. Image titled Make a List Within a Cell in Excel Step 9

      4

      Right-click the cell. The context menu will expand.

    5. Image titled Make a List Within a Cell in Excel Step 10

      5

      Click the clipboard icon under «Paste Options.» The icon has a clipboard and a black rectangle. This pastes the list into the cell you double-clicked. Each list item will appear on its own line within the same cell.

    6. Advertisement

    1. Image titled Make a List Within a Cell in Excel Step 11

      1

      Open the workbook in which you want to create a drop-down list. If you want to be able to click a cell to view and select from a drop-down list, you can create a list with Excel’s data validation tool.[3]

    2. Image titled Make a List Within a Cell in Excel Step 12

      2

      Create a new worksheet in the workbook. You can do this by clicking the + next to the existing workbook sheets at the bottom of Excel. This worksheet is where you’ll enter the items that you want to appear in your drop-down list.

      • After you create the list on a separate sheet and add it to a table, you’ll be able to create a drop-down list containing the list data in any cell you want.
    3. Image titled Make a List Within a Cell in Excel Step 13

      3

      Type each list item into a single column. Enter every possible list choice into its own separate cell. The items you type will all be available in the drop-down list.

      • If you plan to make a lot of drop-down menus and want to use this same sheet to create all of them, add a header to the top of the list. For example, if you’re making a list of cities, you could type City into the first cell. This header won’t actually appear on the drop-down list you create—it’s just for organization on this sheet that contains list data.
    4. Image titled Make a List Within a Cell in Excel Step 14

      4

      Highlight the entire table and press Ctrl+T. Include the header at the top of the list when highlighting. This opens the Create Table dialog.

    5. Image titled Make a List Within a Cell in Excel Step 15

      5

      Choose a header option and click OK. If you added a header to the top of your list, check the box next to «My table has headers.» If not, make sure there is no checkmark there before clicking OK.

      • Now that your list is in a table, you can make changes to it after creating your drop-down list, and your drop-down list will update automatically.
    6. Image titled Make a List Within a Cell in Excel Step 16

      6

      Sort the list alphabetically. This will keep your list organized once you add it to your sheet. To do this, just click the arrow next to your header cell and select Sort A to Z.

    7. Image titled Make a List Within a Cell in Excel Step 17

      7

      Click the cell on the worksheet in which you want to add the list. This can be any cell on any worksheet in the workbook.

    8. Image titled Make a List Within a Cell in Excel Step 18

      8

      Type a name for the list into the cell. This is the cell where the list will appear, so give it a name that indicates the type of option you should choose from that list. For example, if you made a list of cities, you could type City here.

    9. Image titled Make a List Within a Cell in Excel Step 19

      9

      Click the Data tab and select Data Validation. Make sure the cell is selected before doing this. If you don’t see Data Validation in the toolbar, click the icon in the «Data Tools» section that has two black rectangles with a green checkmark and a red circle with a line through it. This opens the Data Validation window.

    10. Image titled Make a List Within a Cell in Excel Step 20

      10

      Click the «Allow» menu and select List. Additional options will expand.

    11. Image titled Make a List Within a Cell in Excel Step 21

      11

      Click the up-arrow in the «Source» field. This minimizes the Data Validation window so you can select your list data.

    12. Image titled Make a List Within a Cell in Excel Step 22

      12

      Select the list (without the header) and press Enter or Return. Click back over to the tab that has your list data and drag the mouse cursor over just the list items. Pressing Enter or Return will add the range to the «Source» field.

    13. Image titled Make a List Within a Cell in Excel Step 23

      13

      Click OK. The selected cell now has a drop-down list. If you need to add or remove items from the list, you can simply make those changes on your new worksheet and they’ll automatically propagate to the list.

    14. Advertisement

    Ask a Question

    200 characters left

    Include your email address to get a message when this question is answered.

    Submit

    Advertisement

    Thanks for submitting a tip for review!

    About This Article

    Article SummaryX

    1. Double-click the cell.
    2. Press Alt + 7 or Option + 8 to add a bullet point.
    3. Type a list item.
    4. Press Alt + Enter (PC) or Control + Option + Return (Mac) to go to the next line.
    5. Repeat until your list is finished.

    Did this summary help you?

    Thanks to all authors for creating a page that has been read 62,222 times.

    Is this article up to date?

    A Custom List in Excel is very handy to fill a range of cells with your own personal list.

    It could be a list of your team members at work, countries, regions, phone numbers, or customers. The main goal of a custom list is to remove repetitive work and manual errors.

    It is extremely useful when you need to fill in the same data from time to time. There are two options to create a list in Excel that can be used repeatedly by using the fill handle.

    In this tutorial, you will learn how to create a list in Excel:

    • Using Pre-existing List
    • Create a list in Excel manually
    • Import from another worksheet

    Let’s look at each of these methods one-by-one!

    Watch it on YouTube and give it a thumbs-up!

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    Download this Excel Workbook and follow along with the tutorial on how to create a list in Excel :

    Using Pre-existing List

    At first, it might seem like magic how Excel does this!

    There are some lists that are already stored in Excel like days of the week and months in a year.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    To demonstrate the power of Excel’s Custom Lists, we’ll explore what’s currently in Excel’s memory as a default list:

    STEP 1: Type February in the first cell

    Custom List-1

    STEP 2: From that first cell, click the lower right corner and drag it to the next 5 cells to the right

    Custom List-02

    STEP 3: Release and you will see it get auto-populated to July (The succeeding months after February)

    Custom List-03

    Create a list in Excel manually

    You can also manually add new values in the Custom List box and re-use them whenever you wish to.

    Let us go straight into the Options in Excel to view how it’s being done, and how you can create your own Custom List:

    STEP 1: Select the File tab

    Custom List-04

    STEP 2: Click Options

    Custom List-05

    STEP 3: Select the Advanced option

    Custom List-06

    STEP 4: Scroll all the way down and under the General section, click Edit Custom Lists.

    Custom List-07

    Here you can see the built-in default Excel lists of the calendar months and the days.

    If you click on a Custom List, you will see under List entries that it is greyed out and you cannot make any changes.  This indicated that it is a default Excel Custom List.

    Default Custom List

    STEP 5: You can create & add your own Custom List under the List entries section.

    Click on NEW LIST under the Custom Lists area and then manually enter your list, entering one entry per line:

    create new list

    After typing the values, click Add.

    In our screenshot below, we added the values of the Greek alphabet (alpha, beta, gamma, and so on)

    Click OK once done.

    Custom List 08

    STEP 6: Click OK again

    Custom List 09

    STEP 7: Now let’s go back into our Excel workbook to see our new Custom List in action. Type alpha on a cell.

    Custom List 10

    STEP 8: From that cell, click the lower right corner and drag it to the next 5 cells to the right

    Custom List 11

    STEP 9: Release and you will see it get auto-populated to zeta, which is based on our Custom List created in Step 8

    Custom List 12

    Next up is a demonstration of how to make a list in Excel by importing data from another worksheet.

    Import from another worksheet

    You can easily import a custom list from another worksheet. Follow the steps below to get this done:

    STEP 1: Go to the File Tab.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 2: Select Options from the left panel.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 3: In the Excel Options dialog box, select Advanced.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 4: Under the General section, click on the Edit Custom List button.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 5: In the Custom List dialog box, select the small arrow up button.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 6: Select the range containing the custom list.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 7: Click on Import.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 8: Once the list will appear under list entries and click OK.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 9: Click OK.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    Now, your custom list is stored in Excel!

    STEP 10: Type the first entry of the list “XS” in cell A8.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    STEP 11: From that first cell, click the lower right corner and drag it to the next 6 cells to the right.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    The entire list will be displayed in the selected range!

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    You can even create this list vertically. Simply, type the XS in a cell. Click on the lower right corner and drag the cell downwards.

    3 Quick Ways on How To Create A List In Excel | MyExcelOnline

    The list will appear vertically!

    Conclusion

    In this article, you have learned how to make a list in Excel so that you don’t have to type the same list over and over again. You use the Custom list feature in Excel and store it in Excel and use it whenever necessary.

    You can either use the pre-existing list, manually type the list or link it from another worksheet!

    Make sure to download our FREE PDF on the 333 Excel keyboard Shortcuts here:

    Microsoft Excel Training

    You can learn more about how to use Excel by viewing our FREE Excel webinar training on Formulas, Pivot Tables, Power Query, and Macros & VBA!

    Oz_Podcast_Banner

    The Excel team recently announced new dynamic array formulas, which can create unique lists, sort and filter with a simple formula. These new formulas are being rolled out to Office 365 subscribers over the next few months. However, not everybody has the subscription and will upgrade when it is sensible for their business, often combining it with a hardware refresh. Therefore, it could be 6 or more years before enough users have the new functionality to use it safely and ensure compatibility. So how can we list duplicate values, or unique values in Excel using traditional Excel methods? We will cover that in this post.

    COUNTIF is an untapped powerhouse for most Excel users. Counting cells which meet specific criteria may not seem particularly useful, but when combined with other functions, and boolean (true/false) logic, it creates new capabilities you never thought possible.

    This post looks at one aspect of this and considers how to use the COUNTIF function to create and compare lists to check for duplicate or unique values. We’ll start with some basic scenarios and slowly layer on the complexity until we achieve some advanced formula magic.

    Comparing two unique lists

    The COUNTIF function can be used to compare two lists and return the number of items within both lists.

    Let’s look at an example. In the screenshot below there is a list of students from St John’s school (Cells A2 – A7) and a list of students who attended a specific exam (Cells B2-B6). We have been asked to identify the number of individuals who are on both lists (i.e., how many from St John’s school attended the exam).

    COUNTIF to Compare Unique Lists

    The formula in Cell E2 is:

    {=SUM(COUNTIF(A2:A7,B2:B6))}

    Usually, COUNTIF will count the number of items from a list which meet a single criteria. In this case, we have not provided a single criteria, but have used a range of cells. As we have not used any logic operators, such as greater than ( > ), Excel by default, applies equals ( = ) as it’s logic operator. This formula will therefore, compare each cell in the Range B2 – B6 to identify if it is equal to any cells in the Range A2 – A7.

    In this example, there are multiple calculations all occurring within the same formula. Calculation 1 compares Cell B2 to Cells A2:A7, calculation 2 compares Cell B3 to Cells A2:A7, etc etc. In total there are 5 separate results all calculated at the same time; this type of formula is known as an array formula.

    The COUNTIF function will calculate down as follows:

    {=SUM({1;0;1;1;0})}

    Notice how all 5 results are shown, each separated by a semi-colon. By wrapping this within the SUM function it will add the list of 1’s and 0’s, which is the number of items which appear on both lists.

    As this is an array formula do not type the curly bracket at the start or end of the formula, Excel will include these itself when you press Ctrl + Shift + Enter to enter the formula into the cell or formula bar.

    If we wanted to avoid pressing the Ctrl + Shift + Enter, we could use the SUMPRODUCT function, rather than the SUM function. The formula in Cell E4 is:

    =SUMPRODUCT(COUNTIF(A2:A7,B2:B6))

    SUMPRODUCT is a special function which can handle arrays without the need for Ctrl + Shift + Enter.

    Usually, SUMPRODUCT is used to multiply cells or numbers together then add the results of the multiplications. In the way we are using it, there is no multiplication occurring within the SUMPRODUCT function, so it will just sum the result.

    Comparing lists with duplicates

    In the example above, both lists are unique, but what if one of the lists contains duplicates? In this scenario, the result of the formula would be incorrect. I have expanded the example to include duplicates for two Exam Attendees (see screenshot below), Lucy King and Billy Thompson now appear twice in column B. The result of the previous calculation is shown in cells E2 and E4. The result of which is incorrectly calculated as 5. The result has increased by 2 due to the duplicate values.

    COUNTIF to Compare Lists

    When working with unique data it does not matter which list is used in each argument of the COUNTIF function. However, when there are duplicates the first range in the function must be the range containing the duplicates and the second range containing the unique values. Please note this change within the examples for the remainder of this post.

    Count unique items

    The formula in Cell E6 is:

    {=SUM(--(COUNTIF(B2:B8,A2:A7)>=1))}

    This formula is an extension of the example in the section above, but it adds some additional complexity. Let’s take some time to understand how it works.

    A logic test has been added to the formula so that only items where the count is >=1 (i.e., unique values) are included.

    {=SUM(--(COUNTIF(B2:B8,A2:A7)>=1))}

    This logic statement will calculate to TRUE or FALSE.

    {=SUM(--({FALSE;TRUE;TRUE;FALSE;FALSE;TRUE}))}

    It is not possible to use SUM on TRUE or FALSE values. These will need to be converted into values of 1 for TRUE or 0 for FALSE to enable the SUM function to work. There are two options for this:

    • Multiply TRUE/FALSE values by 1
    • Multiply TRUE/FALSE values by – – (minus, minus).

    On our example, I have opted to use the double minus method. Now the formula has calculates down as follows:

    {=SUM({0;1;1;0;0;1})}

    The SUM function will return the value of 3, which is correct.

    If we wanted to avoid Ctrl + Shift + Enter, SUMPRODUCT is an option, as shown in Cell E8:

    =SUMPRODUCT(--(COUNTIF(B2:B8,A2:A7)>=1))

    Count duplicates

    By applying the same formulas, but changing the logic threshold we can calculate the number of duplicate values.

    The formula in Cell E10 is:

    {=SUM(--(COUNTIF(B2:B8,A2:A7)>=2))}

    As the logic statement requires values greater than or equal to 2, it will only count the duplicates.

    Again we can use SUMPRODUCT to avoid pressing Ctrl + Shift + Enter, as shown in Cell E12:

    =SUMPRODUCT(--(COUNTIF(B2:B8,A2:A7)>=2))

    Count unmatched items

    The final measure of interest may be the number of items not matching either list. For this, the logic statement changes again to show only the items where the count is equal to zero.

    The formula in Cell E14 is:

    ={SUM(--(COUNTIF(B2:B8,A2:A7)=0))}

    The non-Ctrl + Shift + Enter version in Cell E16 is:

    =SUMPRODUCT(--(COUNTIF(B2:B8,A2:A7)=0))

    Extract a list of unique values

    Using this concept of comparing two lists with COUNTIF, we can not only count unique values, but also extract a list of unique values.

    The example data has now changed. Column A contains a list of students who attended an exam, but it contains duplicates. We will use this data to create a unique list of value, as shown in Column B.

    COUNTIF - Unique & Duplicate Lists

    The formula in Cell B3 is:

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,COUNTIF(B2:B$2,A$2:A$16),0)),"")}

    This is an array formula which requires Ctrl + Shift + Enter.

    This formula uses what we have already learned about COUNTIF and expands it even further. Let’s explore this in more detail.

    Understanding the formula

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,COUNTIF(B2:B$2,A$2:A$16),0)),"")}

    Notice how the COUNTIF function includes a relative and an absolute cell reference to the row numbers within the first argument (B2:B$2), this ensures that when the function copies down the range of cell increases in size.

    For this first cell there is nothing in our list of unique values (as the unique list is currently just the blank value in Cell B2), therefore the COUNTIF returns zeros for every result.

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,{0;0;0;0;0;0;0;0;0;0;0;0;0;0;0},0)),"")}

    Next, we’ll look at the MATCH function.

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,{0;0;0;0;0;0;0;0;0;0;0;0;0;0;0},0)),"")}

    This function returns the position of the first 0 using the exact match method. The result of the MATCH function is 1 because the first 0 is in the first position.

    {=IFERROR(INDEX(A$2:A$16,1),"")}

    Next, the INDEX function will find the cell in the Range A2 – A16 which has a position of 1 (i.e., the first cell). This calculates down as follows:

    {=IFERROR("Lucy King","")}

    When using this formula, we do not have to know how many unique values there are as the IFERROR function ensures a blank is returned once the bottom of the unique list is reached.

    Copy down the formula

    Drag the formula in Cell B3 down to provide enough rows for the current data and any future growth.

    It is difficult to appreciate this formula by looking only at the first result, therefore to get a better understanding of how this formula really works look at Cell B4.

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,COUNTIF(B$2:B3,A$2:A$16),0)),"")}

    COUNTIF will now down calculate as follows:

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,{1;0;0;0;0;0;1;0;0;0;0;1;0;0;0},0)),"")}

    There are now 1’s within the result. These occur each time the values in Cells B2 – B3 appear in Cells A2 – A16. When the MATCH function looks for 0’s it will now return the 2nd item in the list (which is the next unique item).

    For the next example, check out Cell B6:

    {=IFERROR(INDEX(A$2:A$16,MATCH(0,{1;1;1;0;0;0;1;0;0;0;0;1;1;0;0},0)),"")}

    As more items are now included within the unique list (which has now grown to Cells B2 – B5) more 1’s will appear. The fourth item in the list is the first zero, so that value is returned.

    As the formula copies down further there will be less 0’s remaining.

    When there are no 0’s remaining (i.e., the list contains all the unique values) the MATCH function will return errors. These errors are captured by the IFERROR statement and turned into blank cells with two quotation marks (“”).

    If you wish to avoid Ctrl + Shift + Enter, we cannot use SUMPRODUCT as before. Instead, we can use the INDEX function to process the array. The change required is highlighted below.

    =IFERROR(INDEX(A$2:A$16,MATCH(0,INDEX(COUNTIF(B2:B$2,A$2:A$16),),0)),"")

    Having looked at extracting a list of unique values, we now move on to consider extracting a list of duplicate values.

    COUNTIF - Unique & Duplicate Lists

    The formula in Cell D3 is so long that it is included on two lines below, but you can have it on a single line within Excel.

    =IFERROR(INDEX(A$2:A$16,MATCH(1,
    ((COUNTIF(D2:D$2,A$2:A$16)=0)*(COUNTIF(A$2:A$16,A$2:A$16)>=2)),0)),"")

    The differences to the unique formula in the section above are highlighted below:

    {=IFERROR(INDEX(A$2:A$16,MATCH(1,
    ((COUNTIF(D2:D$2,A$2:A$16)=0)*(COUNTIF(A$2:A$16,A$2:A$16)>=2)),0)),"")}

    The first COUNTIF function has changed to include a logic test for where the value equals 0. We know that 0 appears where the item does not already appear in the list. If it equals 0 the result will be TRUE, otherwise it will be FALSE.

    The second COUNTIF function is comparing the source list to itself to count the number of instances of each value. Where the count is greater than or equal to 2 (i.e., it is a duplicate value) TRUE will be returned, otherwise it will return FALSE.

    As we now have two lists of TRUE/FALSE we can multiply these together. Where there are two TRUE values (i.e., the value appears more than once in the master list and it does not already appear in our list of duplicates). the multiplication returns 1, all other values will contain a FALSE value, so will multiply to 0.

    We change the MATCH function to find 1, rather than 0.

    Drag this formula down, and we have created a list of duplicate values.

    Once again, if you wish to avoid Ctrl + Shift + Enter, use the INDEX function to process the array. The change required is highlighted below.

    =IFERROR(INDEX(A$2:A$16,MATCH(1,
    INDEX(((COUNTIF(D2:D$2,A$2:A$16)=0)*(COUNTIF(A$2:A$16,A$2:A$16)>=2)),)
    ,0)),"")

    Why use a complicated formula?

    But there are plenty of other options for creating unique lists and identifying duplicates:

    • Pivot Table
    • Power Query
    • Remove Duplicates from the Data Ribbon

    Each of these options is easier to understand than the complex formulas we have created, so why bother them? Wouldn’t it be easier to use one of those other methods? Yes and No.

    Those options all require either a macro or user interaction to work. For Pivot Tables and Power Query the user must “Refresh” the data. For Remove Duplicates, the user must manually remove the duplicates each time a change occurs.

    A formula has one significant advantage; it can be completely dynamic and automatically update when the data changes. If the source data is either an Excel Table or a Dynamic Named Range the list of unique or duplicates can be updated even when new data is added is added to the source data. In my opinion, this makes it a much more usable solution.

    Until we get the new dynamic array formulas are rolled out and well established, the methods above are probably these option available.

    Conclusion

    As we have seen, the simple COUNTIF function is significantly more powerful than most Excel users realize. By using a range as the criteria we were able to create an array formula which holds multiple calculations within a single cell. Then, when combined with INDEX and MATCH it is possible to list unique or list duplicate values.

    Understanding how Excel handles TRUE/FALSE is a crucial part of creating advanced formulas within Excel.

    Related Posts:

    • UNIQUE function in Excel
    • Understanding basic array formulas
    • Dynamic arrays in Excel

    Headshot Round

    About the author

    Hey, I’m Mark, and I run Excel Off The Grid.

    My parents tell me that at the age of 7 I declared I was going to become a qualified accountant. I was either psychic or had no imagination, as that is exactly what happened. However, it wasn’t until I was 35 that my journey really began.

    In 2015, I started a new job, for which I was regularly working after 10pm. As a result, I rarely saw my children during the week. So, I started searching for the secrets to automating Excel. I discovered that by building a small number of simple tools, I could combine them together in different ways to automate nearly all my regular tasks. This meant I could work less hours (and I got pay raises!). Today, I teach these techniques to other professionals in our training program so they too can spend less time at work (and more time with their children and doing the things they love).


    Do you need help adapting this post to your needs?

    I’m guessing the examples in this post don’t exactly match your situation. We all use Excel differently, so it’s impossible to write a post that will meet everybody’s needs. By taking the time to understand the techniques and principles in this post (and elsewhere on this site), you should be able to adapt it to your needs.

    But, if you’re still struggling you should:

    1. Read other blogs, or watch YouTube videos on the same topic. You will benefit much more by discovering your own solutions.
    2. Ask the ‘Excel Ninja’ in your office. It’s amazing what things other people know.
    3. Ask a question in a forum like Mr Excel, or the Microsoft Answers Community. Remember, the people on these forums are generally giving their time for free. So take care to craft your question, make sure it’s clear and concise.  List all the things you’ve tried, and provide screenshots, code segments and example workbooks.
    4. Use Excel Rescue, who are my consultancy partner. They help by providing solutions to smaller Excel problems.

    What next?
    Don’t go yet, there is plenty more to learn on Excel Off The Grid.  Check out the latest posts:

    Понравилась статья? Поделить с друзьями:
  • Listing rows in excel
  • Locked cell excel vba
  • Listing references in word
  • Lock words in word 2010
  • Listing numbers in excel