Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula to Find Unique Values in List

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To find unique values in an Excel list, the fastest method is to use the UNIQUE function (available in Microsoft 365, Excel 2021, and later). For example, if your list is in A2:A100, enter =UNIQUE(A2:A100) in an empty cell, and Excel will spill the unique values into the cells below. If you have an older Excel version without UNIQUE, you can use a combination of INDEX, MATCH, and COUNTIF to extract unique values manually, or use a PivotTable. This guide covers both approaches, plus common pitfalls and troubleshooting.

What You'll Need

  • Microsoft Excel (any modern version; UNIQUE requires Excel 2021 or Microsoft 365).
  • A list of values in a single column (or row) that may contain duplicates.
  • An empty area of the worksheet where the unique values can be displayed.

Step-by-Step

  1. Identify your list range. Suppose your data is in column A, starting at A2 and ending at A100. Note the exact range; you'll use it in the formula.
  2. Choose a destination cell. Click an empty cell where you want the first unique value to appear, for example, C2. Ensure there is enough empty space below and to the right for the results to spill.
  3. Enter the UNIQUE formula (modern Excel). Type =UNIQUE(A2:A100) and press Enter. The unique values will automatically spill into the cells below. If you want to treat the list as a whole and ignore blanks, you can use =UNIQUE(FILTER(A2:A100, A2:A100<>"")).
  4. For older Excel versions (without UNIQUE), use an array formula. In cell C2, enter the following formula (adjust the range as needed):
    =IFERROR(INDEX($A$2:$A$100, MATCH(0, COUNTIF($C$1:C1, $A$2:$A$100), 0)), "")
    Then press Ctrl+Shift+Enter (not just Enter) to make it an array formula. Drag the fill handle down until you see blank cells. This formula checks each value in the list against the values already extracted above and returns the next unique one. Note: In Excel 365, you can enter it normally and it will work as a dynamic array, but for older versions, CSE is required.
  5. Alternatively, use a PivotTable. Select your list (including the header), go to Insert > PivotTable, place it in a new worksheet, and drag the field to the Rows area. Excel will show each unique value once. This is not a formula but a quick way to get unique values.
  6. Verify the results. Check that the output contains no duplicates and that all expected values are present. If you used the array formula, ensure you dragged it down far enough to cover all possible unique values (the maximum is the count of items in your original list).

Common Mistakes

  • Forgetting to press Ctrl+Shift+Enter for array formulas in older Excel. Without it, the formula returns only the first unique value or an error.
  • Not locking the range references. When dragging the array formula down, the range $A$2:$A$100 must be absolute (with dollar signs) so it doesn't shift. The expanding range $C$1:C1 should be mixed (absolute column, relative row) to grow as you copy down.
  • Using UNIQUE in an unsupported Excel version. If you have Excel 2019 or earlier, UNIQUE will return a #NAME? error. Use the array formula or PivotTable instead.
  • Including blank cells in the list. UNIQUE will return a 0 for blanks if the range includes empty cells. Use FILTER to exclude blanks, or adjust the range to the actual data.
  • Spill range blocked. If there are existing values in the cells where UNIQUE wants to spill, you'll get a #SPILL! error. Clear the area or move the formula.

Tips

  • To get a sorted list of unique values, wrap UNIQUE in SORT: =SORT(UNIQUE(A2:A100)).
  • To count how many times each unique value appears, use =COUNTIF(A2:A100, C2) next to each unique value.
  • If you want to extract unique values from multiple columns, you can use UNIQUE on a combined range (e.g., UNIQUE(VSTACK(A2:A100, B2:B100)) in Excel 365).
  • For a dynamic list that updates when the source changes, use an Excel Table (Insert > Table) and refer to the table column; UNIQUE will automatically adjust.
  • Remember that UNIQUE is case-sensitive? Actually, UNIQUE treats "Apple" and "apple" as different. To ignore case, use UNIQUE(LOWER(A2:A100)) but that changes the output to lowercase. Alternatively, use a helper column with LOWER and then UNIQUE.

Troubleshooting

  • #NAME? error: Your Excel version does not support UNIQUE. Use the array formula method or upgrade to Microsoft 365.
  • #SPILL! error: The spill range is not empty. Select the cells that UNIQUE wants to fill and clear them, or move the formula to a location with enough empty space.
  • Formula returns only one value or zeros: For the array formula, ensure you entered it with Ctrl+Shift+Enter and that the range references are correct. Also, check that the first cell in the expanding range (e.g., C1) is a header or blank, not part of the data.
  • Blanks appear in the unique list: If your source range includes empty cells, UNIQUE will return a 0. Use FILTER to exclude blanks: =UNIQUE(FILTER(A2:A100, A2:A100<>"")).
  • Array formula not working in Excel 365: In Excel 365, you can enter the array formula without CSE, but if you copy it down, it may not behave as expected. Use the UNIQUE function instead for simplicity.

Frequently Asked Questions

Can I use UNIQUE in Excel 2019?

No, UNIQUE is only available in Excel 2021, Microsoft 365, and later. For Excel 2019 and earlier, use the INDEX/MATCH/COUNTIF array formula or a PivotTable.

How do I get unique values from a list that includes blanks?

Use =UNIQUE(FILTER(A2:A100, A2:A100<>"")) to exclude blanks. For older Excel, you can add a condition to the array formula or filter the list first.

Does UNIQUE work across multiple columns?

UNIQUE can accept a range with multiple columns, but it will return unique rows, not unique individual values. To get unique values from multiple columns combined, use UNIQUE(VSTACK(range1, range2)) in Excel 365.

Why does my UNIQUE formula return a #SPILL! error?

The spill range is blocked by existing data. Clear the cells below and to the right of the formula, or move the formula to an empty area.

Can I sort the unique values alphabetically?

Yes, wrap UNIQUE in SORT: =SORT(UNIQUE(A2:A100)). This works in Excel 365 and Excel 2021.