How to find duplicate values in a column
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Flag every value in a list that appears more than once.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique") | Put it next to the first value and fill down. |
| Google Sheets | =IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique") | Identical. |
| LibreOffice Calc | =IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique") | Identical. |
How it works
COUNTIF counts how many times the current row's value appears in the whole list. A count above 1 means the value is duplicated somewhere, so the IF labels it "Duplicate". The $ signs lock the list range so the formula fills down correctly. In the sample list, "apple" appears twice, so its row is flagged.
Verified, not just documented
We ran =IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Duplicate — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned Duplicate for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
IF · COUNTIF — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to check if a value exists in a list
- How to compare two columns row by row
- How to concatenate cells that meet a condition (TEXTJOIN IF)
- How to convert Yes/No (or TRUE/FALSE) to 1 and 0
- How to count cells that contain specific text