Compare 2 Columns in Excel

If you just need to compare 2 columns in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =A2=B2 for row-by-row matches, or =COUNTIF($B:$B,A2)>0 to check whether each value in column A appears anywhere in column B.

On this page7
ƒxCompare Two ListsLive
Values in both lists
2

Only in A: 2 · Only in B: 1

=COUNTIF(B:B,A2)>0
=A2=B2
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

Comparing columns has two different meanings. Row-by-row comparison asks whether A2 equals B2, A3 equals B3, and so on. List comparison asks whether each value from one column exists anywhere in the other column. The first uses a direct equality test; the second uses COUNTIF, MATCH or XLOOKUP. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. Treat “compare 2 columns in excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected columns shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a layout choice that keeps the sheet readable and sortable into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

Column A has invoice IDs from system 1 and column B has IDs from system 2. In C2, =A2=B2 returns TRUE only when the two rows match exactly. If the rows are not aligned, use =COUNTIF($B:$B,A2)>0 in C2; invoice 1042 returns TRUE if it appears anywhere in B, even on a different row. Column comparison is core spreadsheet reconciliation: invoices, IDs, email lists, product codes, migration checks and any workflow where two systems should agree. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. The short version of “compare 2 columns in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Using =A2=B2 when the two lists are sorted differently.
  • Forgetting absolute references in $B:$B, so the lookup range shifts while copying.
  • Treating numbers stored as text as equal to real numbers without cleaning the data.
  • Ignoring leading/trailing spaces; TRIM both columns when matches look visually identical but fail.

Frequently asked questions

How do I compare two columns row by row?

Use =A2=B2 and fill down. TRUE means the values in that row match exactly.

How do I find values in A that are missing from B?

Use =COUNTIF($B:$B,A2)=0 and filter TRUE results.

Can conditional formatting compare columns?

Yes. Use a formula rule such as =$A2<>$B2 for row differences, or COUNTIF for list membership.

Other ways people ask this

People reach this page typing “how to compare 2 columns in excel”, “how do i compare 2 columns in excel”, “compare 2 columns of data in excel” and “excel formula to compare 2 columns”, among other phrasings; whichever wording you used, the fix above is the one you want.

Platform & version notes

  • Several of those searches mention Google Sheets — and the good news is that "compare 2 columns in excel" works there almost identically: the formula syntax carries over unchanged, only the surrounding menus sit across the top of the screen instead of in a ribbon.

Can I do this in Google Sheets too?

Yes. "compare 2 columns in excel" carries over to Google Sheets with the same formula and almost the same steps — the menus are arranged differently, but the result is identical.

Why do people search for this in so many different ways?

Because the same task has many names. “how to compare 2 columns in excel”, “how do i compare 2 columns in excel”, “compare 2 columns of data in excel” all point at the one operation explained on this page, which is why they all lead here.