How to Compare Two Columns or Two Sheets in Google Sheets to Find Matches and Duplicates (2026)
The common version of this question: you have a master list and another list, and you need to know who is on both, who is only on one, or which rows to delete from the first because they appear in the second. A mailing list against an unsubscribe list, last month's customers against this month's, an invitation list against RSVPs. Google Sheets has no single “compare” button, but a few formulas cover it. This guide goes through them, plus the checks that stop a comparison quietly giving the wrong answer.
Step 0: make both lists comparable
A comparison only matches values that are identical. The usual reasons two entries that look the same do not match are a stray leading or trailing space, a non-breaking space pasted in from a web page or PDF, text versus numbers (00123 as text against 123), and different spellings of the same email. The formulas below ignore letter case, but they do not ignore spaces. If your lists are messy, build a cleaned helper column first and compare that:
=LOWER(TRIM(SUBSTITUTE(A2, CHAR(160), " ")))
TRIM removes extra spaces at the ends and collapses runs inside, and SUBSTITUTE turns non-breaking spaces (character 160) into ordinary ones first. Fill it down next to each list and compare the helper columns instead of the originals.
Two columns on the same sheet
Say list one is in A2:A and list two in C2:C. In B2, flag each item of list one that also appears in list two:
=IF(A2="", "", IF(COUNTIF($C$2:$C, A2) > 0, "In both", "Only in list 1"))
Do the mirror image in D2 for list two (=IF(C2="", "", IF(COUNTIF($A$2:$A, C2) > 0, "In both", "Only in list 2"))). Or, to produce the lists directly, in empty cells:
Items in both: =IFERROR(FILTER(A2:A, A2:A<>"", COUNTIF(C2:C, A2:A) > 0), "None") Only in list 1: =IFERROR(FILTER(A2:A, A2:A<>"", COUNTIF(C2:C, A2:A) = 0), "None") Only in list 2: =IFERROR(FILTER(C2:C, C2:C<>"", COUNTIF(A2:A, C2:C) = 0), "None")
These return live lists that update when either column changes. COUNTIF(C2:C, A2:A) inside FILTER works through an array of criteria, which is why it can return one answer per row.
Two tabs in the same spreadsheet
The same formulas work with a sheet name in front of the range. With a Contacts tab and an Unsubscribes tab, put this in a helper column on Contacts (row 2, email in column C, unsubscribe emails in column A of the other tab) and fill down:
=IF(C2="", "", IF(COUNTIF(Unsubscribes!$A$2:$A, C2) > 0, "Unsubscribed", ""))
The C2="" guard means a blank email is not marked Unsubscribed just because the other tab has a blank cell. Filter that column on Unsubscribed, delete those rows, then remove the helper column. To get the keep-list without touching the original, use =FILTER(Contacts!A2:D, COUNTIF(Unsubscribes!A2:A, Contacts!C2:C) = 0). If you want to find the names, not drop them, highlight instead: select the email column on Contacts, open Format › Conditional formatting, choose Custom formula is and enter =AND($C2<>"", COUNTIF(INDIRECT("Unsubscribes!A2:A"), $C2)>0). (Conditional formatting rules cannot point at another tab directly, so the reference goes through INDIRECT.)
Two different spreadsheets
When the other list lives in another file, pull it into a tab with IMPORTRANGE:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/YOUR_FILE_ID/edit", "Sheet1!A2:A")
The first time, Sheets asks you to allow access between the two files. Put the formula on a helper tab, then compare against that tab as above. The imported list is live, which is handy, but it also means deleting the source or losing access breaks your comparison.
Matching on more than one column
If a row only counts as a match when several columns agree, such as first name, last name and postcode, join them into one key in each list and compare the keys:
=LOWER(TRIM(A2)) & "|" & LOWER(TRIM(B2)) & "|" & LOWER(TRIM(C2))
The | separator stops Ann + Marie Lee from matching Ann Marie + Lee. Alternatively, a lookup that returns a value from the second list for each match is =IFERROR(INDEX(Other!B:B, MATCH(A2, Other!A:A, 0)), "not found") (the 0 means exact match). MATCH returns the position of the first match only.
Things that go wrong
- Duplicates inside one list. A comparison tells you what is in both lists, not what repeats within one. Clean each list's own repeats first, see how to find and remove duplicates.
- Whole columns are slow. A
COUNTIFover a few thousand rows against another few thousand is fine; tens of thousands of rows can make the sheet recalculate for a long time. Use bounded ranges and paste results as values when you are finished. - Near-misses are not matches.
Jon ParkandJohn Park, orj.doe@gmail.comandjdoe@gmail.com, will show up as “only in list”. See duplicates that don’t match exactly. - Deleting rows by formula result. If you delete rows while a helper column depends on them, the results can change under you. Copy the helper column and paste it as values before filtering and deleting.
Install free from Google Workspace MarketplaceSee SheetDupes
Want to test it first? Try it on sample data (makes a copy of a 12-row example sheet in your Drive).
Related guides
- How to Highlight Duplicates in Google Sheets: Conditional Formatting Formulas for One Column, Whole Rows, Repeats Only and Two Sheets (2026)
- How to Find and Remove Duplicates in Google Sheets: Highlight, Count, Delete and Keep the Original (2026)
- Duplicates That Don’t Match Exactly in Google Sheets: Case, Extra Spaces, Gmail Dots, Phone Formats and Typos (2026)
- How to Remove Duplicates in Google Sheets but Keep the Latest, First or Highest Row per Key (2026)
- How to Prevent Duplicate Entries in Google Sheets: Data Validation Rules, Warnings and a Small Script (2026)
- How to Count Duplicates in Google Sheets: per Value, Extra Rows, Unique Counts and Why the Numbers Disagree (2026)
- How to Combine Two Lists or Several Tabs in Google Sheets Without Duplicates: VSTACK, UNIQUE, One Row per Key and Other Files (2026)
- How to Merge Duplicate Rows in Google Sheets: Sum the Numbers, Join the Notes and Fill the Blanks (2026)
- UNIQUE vs Remove Duplicates in Google Sheets: Live or Static, Letter Case, Spaces, Columns and Headers (2026)
- How to Remove Duplicates Within a Cell in Google Sheets: Comma-Separated Lists, Tags, Line Breaks and Letter Case (2026)
- How to Show Only the Duplicates in Google Sheets: Filter Duplicate Rows, List Repeated Values and Find Rows That Appear Once (2026)
- How to Find Duplicates Across Multiple Columns in Google Sheets: Rows That Match on Two or More Columns, and Values Repeated Anywhere in a Range (2026)
- How to Remove Duplicates Automatically in Google Sheets: Apps Script on a Daily Timer, on Form Submit or From a Menu (2026)
- How to Find Duplicates in Google Sheets but Ignore Blank Cells: Highlight, Count, List and Remove Without Empty Rows Getting in the Way (2026)
- How to Find Duplicate Transactions in Google Sheets: Double-Imported Rows, Invoices Paid Twice and Same-Amount Charges Within a Few Days (2026)
- How to Format Phone Numbers in Google Sheets: Strip Dashes and Spaces, Show (555) 010-1234, Handle +1 and Extensions, Then Find Duplicate Contacts (2026)
- How to Change Text Case in Google Sheets: UPPERCASE, lowercase, Proper Case Names, Sentence Case and Duplicates That Differ Only in Case (2026)
- Mailing labels: one per household, clean addresses
- Automatic email reminders from a date column
- How to generate a PDF or Google Doc for each row in Google Sheets
Instructions refer to Google Sheets as it worked on November 16, 2026. Google Sheets is a trademark of Google LLC and this site is not affiliated with Google. Questions or corrections: hello@loomwise.app.