formulahelper

How to compare two columns in Google Sheets

Google Sheets has FILTER in every spreadsheet, so a list of missing values takes one formula and no special key presses. A few details differ from Excel, and they are exactly the ones that make copied Excel formulas fail. This page covers both.

Worked example on made-up data

A small example: two lists, the formula our tool produced for them and the result of computing it. The data is invented for the example.

A list of invited guests, a list of replies and a third column listing the guests who have not replied
Sheet snapshot: the example computed in LibreOffice Calc (made-up data). In Excel and Google Sheets you enter the formula the same way; the interface looks different.

Formula for Google Sheets

=IFERROR(FILTER($A$2:$A$7,($A$2:$A$7<>"")*(ISNA(MATCH($A$2:$A$7,$B$2:$B$5,0)))),"")

The formula was verified by computing it on this example (6 rows in the first list, 4 in the second): the result equals the reference answer. The example was also recomputed in LibreOffice Calc with the same result.

FILTER keeps only the values of $A$2:$A$7 that are not in $B$2:$B$5 and returns them as a list. Paste into C2 and press Enter — the list spills down by itself (Excel 365, Google Sheets). The cells below must be empty.

Other verified variants

  • INDEX/SMALL (array) =ARRAYFORMULA(IFERROR(INDEX($A$2:$A$7,SMALL(IF($A$2:$A$7="","",IF(ISNA(MATCH($A$2:$A$7,$B$2:$B$5,0)),ROW($A$2:$A$7)-ROW($A$2)+1)),ROWS($A$2:A2))),""))

Values of the first list that are not in the second (3)

Iqbal, Kowalski, Laine

Compare your own lists

The tool below is already set up for this task. Paste your columns to get a formula for your version and the list, both checked by computing. 3 free comparisons a day, no sign-up.

What to find
Spreadsheet
Excel version
Formula language
How to compare
Output
Addresses and wishes (optional)
Free comparisons left today: 3

Pro for $7/month

Pro is coming — leave nothing, we just count interest.

The formula

FILTER returns the rows of the first range where the condition holds: the cell is not empty and MATCH cannot find it in the second range. Put it in one cell and the result fills as many rows as needed. In the example six people were invited, four replies came in, and one of them (Novak) was not on the invitation list. The formula returns Iqbal, Kowalski and Laine.

Why IFERROR and not a third argument

In Excel 365 FILTER takes a third argument for "nothing found". In Google Sheets every extra argument is another condition, so the Excel form does not mean the same thing there. When nothing is missing, FILTER in Sheets returns an error; IFERROR around it turns that into an empty cell. The tool gives the Sheets form whenever you pick Google Sheets.

Steps

  1. Pick an empty cell to the right of your data, for example C2.
  2. Paste the formula and adjust both ranges to your columns.
  3. Press Enter; the list appears at once and needs no copying down.
  4. Keep the cells below free — if something is in the way, Sheets reports that the array result could not expand.

Separators and function names

The argument separator follows the spreadsheet's locale: many European locales use a semicolon instead of a comma. Function names follow the interface language unless "Always use English function names" is switched on. If a pasted formula shows a parse error, check these two settings first.

Common mistakes

Array formulas copied from old Excel

Formulas that Excel 2010–2019 needs to confirm with Ctrl+Shift+Enter must be wrapped in ARRAYFORMULA in Sheets. The tool adds it automatically when it returns such a variant.

Imported numbers stored as text

Data brought in with IMPORTRANGE or from a CSV often keeps numbers as text. If the list of missing values looks too long, tick "Numbers and text are equal".

Whole-column references

A range like A:A also takes in the header, which then gets compared like any other value. Start the range at the first data row, for example A2:A500.

Questions and answers

Does it work in the Sheets mobile app?

Yes, formulas calculate the same way in the app and in the browser; long formulas are easier to paste on a computer.

Can the second column be in another tab?

Yes. Reference it as 'Replies'!A2:A100, or enter the tab name where list B starts in the tool.

How do I highlight the missing values instead?

Use Format → Conditional formatting → Format rules → "Custom formula is" with a MATCH-based condition on the first column. If the second column is in another tab, the rule has to reference it through INDIRECT, for example INDIRECT("Replies!A2:A100"); a direct reference to another tab is not accepted there.