formulahelper

Find values in one column that are not in another

Sometimes a flag next to each row is not enough and you want the missing values on their own, ready to paste into an email or a ticket. This page builds that list with one formula and shows which version of Excel needs which form of it.

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 registered people, a list of attendees and a third column listing the people who registered but did not attend
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 Excel

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

The formula was verified by computing it on this example (7 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$8 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) =IFERROR(INDEX($A$2:$A$8,SMALL(IF($A$2:$A$8="","",IF(ISNA(MATCH($A$2:$A$8,$B$2:$B$5,0)),ROW($A$2:$A$8)-ROW($A$2)+1)),ROWS($A$2:A2))),"")

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

Adams, Clarke, Dixon, Foster

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 result in the example

Seven people registered for a workshop and four names are on the attendance sheet. Hughes attended without registering, which is a different question. The formula lists Adams, Clarke, Dixon and Foster: the people who registered but never showed up, in the same order as the registration list.

Excel 2021 and Microsoft 365 — FILTER

FILTER keeps the rows of the first range for which a condition is true. The condition here is that the cell is not blank and that MATCH does not find it in the second range. Type the formula into one cell and press Enter; the list spills into the cells below. The final "" argument shows nothing instead of an error when every value was found.

Excel 2010–2019 — INDEX and SMALL

  1. These versions have no FILTER, so use the array formula built from INDEX, SMALL, IF and MATCH — it is listed under the example's main formula.
  2. Paste it into the first output cell and confirm with Ctrl+Shift+Enter; Excel adds curly braces around it.
  3. Copy it down as many rows as there could be missing values; the extra cells stay empty.
  4. The list recalculates whenever either column changes.

SMALL picks the k-th smallest row number among the rows that were not found, and INDEX returns the value from that row. ROWS of a growing range supplies k = 1, 2, 3 as the formula is copied down.

Common mistakes

Something below the FILTER result

A spilled list needs empty cells underneath. If anything is in the way, Excel shows #SPILL! instead of the list. Put the formula in a free column or on a new sheet.

Entering the array formula with plain Enter

In Excel 2019 and earlier, an INDEX/SMALL formula entered with plain Enter usually shows the first value or an error in every row. Select the cell, press F2, then Ctrl+Shift+Enter.

Repeated values in the first column

If a missing name appears twice in the first column, it appears twice in the result. Tick "Without duplicates" to list each value once.

Questions and answers

Will the same formula work in Google Sheets?

FILTER works there too, but without the third argument; wrap it in IFERROR instead. Choose Google Sheets in the tool to get that form.

Can the second column be on another sheet?

Yes. Set where list B starts, for example Sheet2!A2, and the formula references that sheet.

How do I count the missing values?

The tool shows the count next to the result. In the sheet, count the flags of a flag column with COUNTIF; COUNTA is not reliable on an INDEX/SMALL list, because its empty-looking cells hold "" and are counted.