A "match or no match" formula in Excel compares two values (or two lists) and returns a clear yes/no answer, such as "Match" or "No Match". The simplest reliable way is to wrap a lookup function like MATCH, ISNUMBER, or COUNTIF inside an IF statement. For example: =IF(COUNTIF(A:A,B2)>0,"Match","No Match"). You need no special add-ins—just Excel itself (the steps below work the same on Windows and Mac, and in Excel for the web).
What You'll Need
- Excel (desktop, Excel for the web, or the mobile app for viewing; formulas are easiest to type on desktop)
- Your two sets of values in a worksheet—e.g., a master list in column A and values to check in column B
- Basic familiarity with typing formulas into a cell and pressing Enter
Step-by-Step
- Set up your data. Put your master list (the values you are checking against) in column A, and the values you want to test in column B. Make sure both columns are the same data type—numbers with numbers, text with text.
- Click the cell where you want the result. For the first comparison this is usually cell C2, next to your first test value in B2.
- Type the formula. To check whether the value in B2 appears anywhere in column A, enter:
=IF(COUNTIF(A:A,B2)>0,"Match","No Match")and press Enter. COUNTIF counts how many times B2 appears in column A; IF converts that into a readable label. - Fill the formula down. Click the cell with your formula, then double-click the small square (the fill handle) at its bottom-right corner. Excel copies the formula down alongside your column B values, adjusting B2 to B3, B4 and so on automatically.
- Alternative: compare two cells directly. If you just want to know whether B2 equals A2 (row by row), use
=IF(A2=B2,"Match","No Match")instead. For a case-sensitive comparison, use=IF(EXACT(A2,B2),"Match","No Match"). - Alternative: use MATCH for exact positions.
=IF(ISNUMBER(MATCH(B2,A:A,0)),"Match","No Match")does the same check using the MATCH function. The 0 forces an exact match, and ISNUMBER handles the #N/A error MATCH returns when nothing is found. - Optional: highlight results visually. Select the result column, then use Home > Conditional Formatting > Highlight Cells Rules > Equal To, type
Match, and pick a fill colour. Repeat for "No Match" with a different colour. (Menu labels can differ slightly between Excel versions and platforms.) - Lock the lookup range if needed. If your formula lives next to data and you plan to move it around, anchor the range with dollar signs:
=IF(COUNTIF($A$2:$A$100,B2)>0,"Match","No Match"). This keeps the lookup list fixed when the formula is copied.
Common Mistakes
- Trailing spaces. "Apple " and "Apple" are different to Excel, so they show as No Match. Use TRIM (e.g.,
TRIM(B2)) or clean the source data first. - Numbers stored as text. A number imported from another system can be stored as text, so 123 will not match "123". Check for the small green triangle warning, or convert with Value or Text to Columns (Data > Text to Columns > Finish).
- Forgetting the 0 in MATCH.
MATCH(B2,A:A)without the third argument does an approximate match, which gives wrong answers on unsorted data. Always include the 0. - Comparing whole columns with headers included. A header cell like "SKU" in column A is harmless here, but if your test value could equal a header text, you will get a false Match.
- Mixing up absolute and relative references. Copying
=IF(COUNTIF(A2:A100,B2)>0,...)down shifts the range too. Anchor it as$A$2:$A$100. - Expecting COUNTIF to be case-sensitive. COUNTIF treats "smith" and "Smith" as identical. Use EXACT for case-sensitive checks.
Tips
- Use TRUE/FALSE output instead of text if you want to filter or build on the results:
=COUNTIF(A:A,B2)>0. - To see where the match is, use
=MATCH(B2,A:A,0)on its own—it returns the row number. - XLOOKUP users can check with
=IF(XLOOKUP(B2,A:A,A:A,"Not found")="Not found","No Match","Match"), though COUNTIF is simpler for a pure yes/no. - For two large lists, convert the master list to an Excel Table (select it, press Ctrl+T) so the range expands automatically when you add rows.
- Freeze the top row (View > Freeze Panes > Freeze Top Row) so headers stay visible while you work down a long list.
Troubleshooting
- Everything says "No Match" even for obvious matches. Almost always a data type or hidden-character issue. Click a cell from each list and look at the alignment—numbers align right, text aligns left. Use
=LEN(A2)and=LEN(B2)to spot invisible trailing spaces (the lengths will differ). - The formula shows #N/A. You probably used MATCH without wrapping it in IF/ISNUMBER. Replace with the ISNUMBER version in step 6.
- The formula shows #NAME? A function name is misspelled, or you typed XLOOKUP in an older Excel version that does not have it. Use the COUNTIF version instead—it works in every version.
- The formula displays as text. The cell is formatted as Text. Change it to General (Home > Number Format dropdown > General), then re-enter the formula.
- Copying down stops early or goes too far. Double-clicking the fill handle copies down as far as the adjacent column has data. If column B has blank cells, drag the fill handle manually or copy and paste the formula into the exact range.
Frequently Asked Questions
What is the simplest match or no match formula in Excel?
=IF(COUNTIF(A:A,B2)>0,"Match","No Match"). It checks whether the value in B2 exists anywhere in column A and labels the result.
How do I compare two columns row by row?
Use =IF(A2=B2,"Match","No Match") in row 2 and fill it down. This only compares the cells on the same row, not the whole list.
Is the comparison case-sensitive?
No. The equals operator and COUNTIF ignore case. Use =IF(EXACT(A2,B2),"Match","No Match") when "abc" and "ABC" must be treated as different.
Can I highlight duplicates between two lists instead of using a formula?
Yes. Select both ranges, then Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Duplicates are highlighted automatically without any formula.
Does this work in Excel for the web?
Yes. COUNTIF, IF, MATCH, ISNUMBER, and EXACT all work identically in Excel for the web; only some menu positions differ slightly.
Why does my number show as No Match when it is clearly in the list?
It is usually stored as text in one column and as a number in the other. Select the column and use Data > Text to Columns > Finish to convert text numbers to real numbers.