Smart Systems for Home

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

Excel NOT UNIQUE Function: How to Find Duplicates

· 7 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

The NOT UNIQUE function in Excel is a dynamic array function that returns every value from a range that appears more than once, so you can see all your duplicate entries in one spill of results. It is the mirror image of the UNIQUE function: where UNIQUE strips duplicates down to one clean list, NOT UNIQUE keeps only the values that repeat. You type =NOT_UNIQUE(range) into a single cell and Excel fills the cells below with every repeated value, including each occurrence. Nothing needs to be installed first, but you do need a Microsoft 365 subscription with a current Excel build, because NOT UNIQUE is one of the newer dynamic array functions and it is not available in Excel 2021, 2019, or older perpetual versions. If your version does not have it, the alternatives in the troubleshooting section below work everywhere.

What You'll Need

  • A Microsoft 365 version of Excel on Windows, Mac, or the web, updated to a build that includes the NOT UNIQUE function. Check with File > Account > About Excel, or on the web via Help > About.
  • A column or range of data you want to check for repeats, ideally with a header row so you can label the output.
  • An empty area of the sheet below and to the right of your formula cell, because the results spill into multiple cells and will show a #SPILL! error if something blocks them.

Step-by-Step

  1. Confirm your Excel version supports it. Open a blank cell and type =NOT_UNIQUE(. If Excel shows the function name in the autocomplete list as you type, you have it. If the name never appears and the formula later returns #NAME?, your build does not include the function and you should use the COUNTIF approach in Troubleshooting instead.
  2. Select the range you want to check. Click the first data cell in your column and drag down to the last populated cell, or reference the whole column range such as A2:A100. Avoid including the header row in the range, or the header text will be treated as a value and may appear in the results if it happens to repeat.
  3. Pick an empty destination cell. Choose a cell with plenty of blank space beneath it. The formula spills downward, one row per repeated value, so if you have 40 duplicates you need 40 free rows. Leaving a couple of blank rows between your data and the formula makes the output easier to read.
  4. Type the formula. Enter =NOT_UNIQUE(A2:A100), replacing A2:A100 with your actual range. Press Enter. Excel returns every value that appears more than once, and it returns each occurrence separately, so a value that appears three times shows up three times in the output.
  5. Read the result correctly. The output is not a deduplicated list. If "Blue" appears four times in your source data, "Blue" appears four times in the NOT UNIQUE output. This is deliberate: it lets you see the full scale of duplication, not just which values are duplicated.
  6. Add a header if you want one. Put a label such as "Repeated values" in the cell above the formula, not inside the formula range. Do not type anything into the spill area itself.
  7. Wrap it in SORT for a tidier list. Use =SORT(NOT_UNIQUE(A2:A100)) to alphabetise or numerically order the duplicates, which makes scanning a long list much faster. You can also wrap it in UNIQUE to get a clean list of which values are duplicated, without the repeats: =UNIQUE(NOT_UNIQUE(A2:A100)).
  8. Count how many times each value repeats. Pair it with COUNTIF in a neighbouring column. If the NOT UNIQUE output starts in D2, put =COUNTIF($A$2:$A$100,D2) in E2 and fill it down. Each row then shows the value and its total occurrence count in the source range.
  9. Copy the results as values if you need to keep them. Spilled results update automatically when the source data changes, which is usually what you want. If you need a frozen snapshot, select the spill range, copy, then use Paste Special > Values. Be aware the copy is static from that point on.
  10. Clear the output when you are done. Select the cell holding the formula and press Delete. The whole spill range clears with it. Deleting individual cells inside a spill range is not allowed and triggers an error.

Common Mistakes

Expecting a deduplicated list. The most frequent confusion is treating NOT UNIQUE like UNIQUE. It returns every instance, so a value repeated five times appears five times. If you want one row per duplicated value, wrap it in UNIQUE as shown above.

Blocking the spill area. If any cell in the path of the results already contains data, Excel returns #SPILL! and shows nothing. Clear the cells below the formula, or move the formula somewhere with room.

Including the header row. Referencing A1:A100 when A1 is "Customer" means the header is treated as data. It usually does no harm, but it can appear in results if the word repeats, and it makes counts confusing. Start the range at the first data row.

Using it in an older Excel version. NOT UNIQUE does not exist in Excel 2021 or earlier. Typing it there produces #NAME?. This is a version limit, not a typo, and no amount of retyping will fix it.

Typing into the middle of a spill range. Excel will not let you overwrite part of a spilled result. Edit the formula cell instead, or delete the formula first.

Tips

Convert your source range to an Excel Table (select the data, then Insert > Table) and reference it by name, such as =NOT_UNIQUE(Table1[Customer]). The formula then expands automatically as you add rows, with no range editing.

To find duplicates across multiple columns rather than one, combine the columns first with a helper column using =A2&"|"&B2 and run NOT UNIQUE on that helper column. The pipe character reduces false matches between values like "AB"+"C" and "A"+"BC".

Apply conditional formatting to the source column with a formula such as =COUNTIF($A$2:$A$100,A2)>1 if you would rather highlight duplicates in place than list them separately. The two approaches complement each other well.

Remember that NOT UNIQUE is case-insensitive by default, so "apple" and "Apple" count as the same value. Trailing spaces also cause mismatches in the other direction: two visually identical entries with different spacing are treated as different values, so trim your data first with TRIM if counts look wrong.

Troubleshooting

You get #NAME?. Your Excel build does not recognise the function. Confirm your version as described in step 1 and update Office. If you are on a perpetual licence such as Excel 2021 or 2019, the function is not available at all. Use this instead: in a blank cell, enter =IF(COUNTIF($A$2:$A$100,A2)>1,A2,"") and fill down alongside your data. Every repeated value appears next to its row, and you can filter out the blanks.

You get #SPILL!. Something is in the way. Select the formula cell; Excel outlines the intended spill range. Clear those cells or move the formula. Merged cells in the spill path also cause this, so unmerge them.

The result looks empty. That means no value in your range repeats, which is a valid answer. Double-check the range reference is correct and not pointing at blank cells.

Counts look wrong. Check for trailing spaces, inconsistent capitalisation, or numbers stored as text. Use TRIM and check the cell format. A quick test is =A2=B2 for two entries that look identical; FALSE tells you there is a hidden difference.

The formula worked and now shows an error. If rows were deleted or the table shrank, the range may now be invalid. Re-point the formula at the correct range.

Frequently Asked Questions

What is the difference between UNIQUE and NOT UNIQUE in Excel?

UNIQUE returns one copy of each distinct value, removing repeats. NOT UNIQUE returns only the values that appear more than once, and returns each occurrence. They are opposites and are often used together.

Is NOT UNIQUE available in Excel 2021 or Excel 2019?

No. It is a Microsoft 365 dynamic array function. Older perpetual versions return #NAME?. Use a COUNTIF-based helper column instead.

Does NOT UNIQUE work in Excel for the web and on Mac?

It works in Microsoft 365 builds on Windows, Mac, and the web. Exact menu labels can differ slightly by version and region, but the function syntax is the same.

Why does my NOT UNIQUE result show the same value several times?

Because it lists every occurrence, not every distinct duplicated value. Wrap it in UNIQUE to collapse the output to one row per repeated value.

Can NOT UNIQUE check two columns at once?

It checks a single range. To compare combinations across columns, build a helper column that joins the values and run NOT UNIQUE on that.

Does it ignore case and blank cells?

It is case-insensitive, so Apple and apple match. Blank cells are not returned as duplicates of each other.