Excel Unique and Remove Duplicates: Step-by-Step Guide
In this article
To get a list of unique values in Excel, use the Remove Duplicates feature on a copy of your data, or use the UNIQUE function if you have Microsoft 365 or Excel 2021. Remove Duplicates physically deletes duplicate rows, while UNIQUE returns a dynamic array of distinct values without altering the source. Both methods work on Windows and Mac; the steps below note where the interface differs.
What You'll Need
- Excel 2016 or later for Remove Duplicates; Excel 2021 or Microsoft 365 for the UNIQUE function.
- Your data in a single worksheet, ideally formatted as a table (select the range and press Ctrl+T on Windows or Command+T on Mac).
- A backup copy of your data before using Remove Duplicates, because the action cannot be undone with Ctrl+Z after saving.
Step-by-Step
- Select your data range. Click any cell inside the dataset and press Ctrl+A (Windows) or Command+A (Mac) to select the current region. If your data has blank rows or columns, select the range manually by dragging from the top-left to the bottom-right cell.
- Make a backup. Right-click the sheet tab and choose Move or Copy, tick Create a copy, and click OK. Work on the copy so your original stays intact.
- Open Remove Duplicates. Go to the Data tab and click Remove Duplicates in the Data Tools group. The dialog box lists every column header in your selection.
- Choose which columns define a duplicate. To remove rows where all values match, leave every column ticked. To treat a row as duplicate based on one column only (for example, email address), untick the others. Excel keeps the first occurrence and deletes later ones.
- Confirm and review. Click OK. Excel reports how many duplicates were removed and how many unique values remain. Check the remaining rows carefully; if something looks wrong, close the file without saving and reopen your backup.
- For a non-destructive unique list, use the UNIQUE function. Click an empty cell where you want the output, type
=UNIQUE(A2:A100)(replace the range with your actual data), and press Enter. The result spills into neighbouring cells automatically. To return only values that appear exactly once, use=UNIQUE(A2:A100,,TRUE). - Combine UNIQUE with FILTER if needed. For example,
=UNIQUE(FILTER(A2:A100,B2:B100="Active"))returns distinct names only for active records. This works in Microsoft 365 and Excel 2021; older versions will show a #NAME? error. - Convert the result to static values if you need to share it. Select the spilled range, copy it, then use Paste Special > Values to replace the formula with plain text. This prevents errors when the file is opened in older Excel versions.
Common Mistakes
- Running Remove Duplicates on the original data without a backup. The deletion is permanent once saved; Ctrl+Z only works before saving and closing.
- Leaving all columns ticked when you meant to deduplicate by one field. Excel then treats rows as duplicates only if every selected column matches, so near-duplicates with a different timestamp or ID survive.
- Assuming UNIQUE works in every Excel version. It is unavailable in Excel 2019 and earlier; those users see #NAME? and must use Remove Duplicates or a helper-column formula instead.
- Forgetting that UNIQUE is case-sensitive by default. "Apple" and "apple" are treated as different values. Use
=UNIQUE(EXACT(range,range))only if you need a case-sensitive comparison, or standardise case first with LOWER or UPPER. - Selecting a range that includes totals or blank rows. Remove Duplicates may delete summary rows or produce misleading counts. Select only the data body.
Tips
- Format your source as an Excel Table (Ctrl+T / Command+T). Remove Duplicates and structured references then adjust automatically as rows are added.
- Use
=COUNTA(UNIQUE(range))to count distinct values quickly, or=ROWS(UNIQUE(range))if the range contains blanks. - To highlight duplicates before deleting anything, use Conditional Formatting > Highlight Cells Rules > Duplicate Values. This is reversible and good for a visual check.
- If you need a unique list that updates when source data changes, keep the UNIQUE formula. If you need a fixed snapshot for reporting, paste it as values.
- On Mac, the Remove Duplicates dialog and Data tab are in the same place, but keyboard shortcuts use Command instead of Ctrl. The UNIQUE function behaves identically.
Troubleshooting
- Remove Duplicates says 0 duplicates removed but you can see repeats. Check that the correct columns are ticked and that trailing spaces are not creating false differences. Use TRIM in a helper column, then deduplicate on that column.
- UNIQUE returns #SPILL!. The output 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.
- UNIQUE returns #NAME?. Your Excel version does not support dynamic arrays. Use Remove Duplicates instead, or upgrade to Microsoft 365 or Excel 2021.
- You accidentally deleted the wrong rows. Close the workbook without saving, then reopen it. If you already saved, restore the backup copy you made in step 2, or use File > Info > Version History if the file is stored on OneDrive or SharePoint.
- Duplicates persist after using UNIQUE. The values may differ by case, hidden spaces, or number formatting (for example, text "123" versus number 123). Standardise with TRIM and VALUE before applying UNIQUE.
Frequently Asked Questions
Does Remove Duplicates delete the entire row or just the duplicate cell?
It deletes the entire row from the selected range, keeping the first occurrence. If you only want to clear duplicate values in one column without removing rows, use UNIQUE or a helper formula instead.
Can I undo Remove Duplicates?
Yes, with Ctrl+Z (Command+Z on Mac) as long as you have not saved and closed the file. After saving, the action is permanent; restore from a backup or version history.
Is UNIQUE available in Excel 2019?
No. UNIQUE requires Microsoft 365 or Excel 2021. In Excel 2019 and earlier, use Remove Duplicates or a combination of INDEX, MATCH, and COUNTIF to build a unique list.
How do I get unique values from multiple columns at once?
In Microsoft 365, use =UNIQUE(VSTACK(A2:A100,B2:B100)) to stack the columns and return distinct values. In older versions, copy both columns into one helper column, then run Remove Duplicates.
Will Remove Duplicates work on a filtered list?
It removes duplicates from the entire selected range, not just visible rows. To deduplicate only filtered rows, copy the filtered results to a new location first, then run Remove Duplicates there.
Does UNIQUE ignore blank cells?
By default, UNIQUE returns a 0 for blank cells in the range. Add the exactly_once argument as FALSE and wrap with FILTER to exclude blanks, for example =UNIQUE(FILTER(A2:A100,A2:A100<>"")).