Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel IF ISERROR MATCH Guide: Find and Handle Missing Data

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Combining the IF, ISERROR, and MATCH functions allows you to check if a specific value exists within a range and return a custom result instead of a messy error message. Essentially, the MATCH function looks for a value; if it cannot find it, it returns an #N/A error. The ISERROR function detects that error, and the IF function tells Excel what to display based on whether that error was found or not. This is most commonly used to create "Found" or "Not Found" flags when comparing two lists.

What You'll Need

  • Microsoft Excel (any version from 2007 onwards).
  • Two sets of data to compare (e.g., a list of IDs in Column A and a master list in Column E).
  • A basic understanding of how to select cell ranges.

Step-by-Step

  1. Prepare Your Data: Ensure your data is organized in columns. For this example, assume you have a list of "Customer IDs" in cells A2 through A10 and a "Master Database" of IDs in cells E2 through E100. You want to know if the IDs in Column A exist in Column E.
  2. Start the IF Function: Click on cell B2 (where you want the result to appear). Type =IF(. The IF function requires three parts: the logical test, the value if true, and the value if false.
  3. Add the ISERROR Wrapper: Inside the IF parenthesis, type ISERROR(. This function will return TRUE if the formula inside it results in any error (like #N/A, #VALUE!, or #REF!) and FALSE if the formula succeeds.
  4. Insert the MATCH Function: Now, inside the ISERROR parenthesis, enter the MATCH formula. The syntax is MATCH(lookup_value, lookup_array, [match_type]).
    Type MATCH(A2, $E$2:$E$100, 0).
    • A2: This is the value you are searching for.
    • $E$2:$E$100: This is the range where Excel should look. The dollar signs ($) are critical; they lock the range (absolute reference) so that when you drag the formula down, the search area doesn't shift.
    • 0: This tells Excel to find an exact match.
  5. Close the ISERROR Parenthesis: Your formula should now look like =IF(ISERROR(MATCH(A2, $E$2:$E$100, 0)). Close the parenthesis for the ISERROR function.
  6. Define the "True" Result: Now you tell Excel what to do if ISERROR is TRUE (meaning the MATCH failed and the value is missing). Type a comma, then your desired text in quotes. For example: , "Not Found".
  7. Define the "False" Result: Finally, add a comma and the text to display if ISERROR is FALSE (meaning the MATCH succeeded and the value exists). Type: , "Found".
  8. Complete the Formula: Close the final parenthesis for the IF function. Your complete formula in cell B2 should be: =IF(ISERROR(MATCH(A2, $E$2:$E$100, 0)), "Not Found", "Found").
  9. Apply to the Rest of the List: Hover your mouse over the bottom-right corner of cell B2 until you see a small black cross (the fill handle). Click and drag this down to cell B10 to apply the logic to all your IDs.

Common Mistakes

One of the most frequent errors is forgetting the absolute references (the dollar signs) in the lookup array. If you use E2:E100 instead of $E$2:$E$100, Excel will shift the search range down by one row for every row you drag the formula. By the time you reach row 10, Excel will be searching from E11 to E109, potentially missing the data you are looking for.

Another common mistake is omitting the match_type (the 0 at the end of the MATCH function). If you leave this blank or set it to 1, Excel assumes your list is sorted in ascending order and will look for the closest match. This often leads to "false positives," where Excel tells you a value was found even though it wasn't an exact match.

Users also frequently forget the quotation marks around text results. In Excel formulas, any plain text must be enclosed in double quotes (e.g., "Missing"). If you type , Missing, Found) without quotes, Excel will think you are trying to reference a named range called "Missing" and will return a #NAME? error.

Tips

If you are using a modern version of Excel (Office 365 or Excel 2013+), you can use the IFERROR function to simplify this process. IFERROR combines the IF and ISERROR logic into one. Instead of =IF(ISERROR(MATCH(...)), "Not Found", "Found"), you could use =IFERROR(MATCH(A2, $E$2:$E$100, 0), "Not Found"). However, this will return the row number if found, rather than the word "Found." To get the word "Found" using IFERROR, you would still need a wrapper or a different approach.

To make your sheet more professional, use Conditional Formatting in conjunction with this formula. You can set a rule that says "If cell contains 'Not Found', fill cell red." This allows you to scan thousands of rows and instantly spot the gaps in your data without reading every single cell.

For very large datasets, consider converting your data ranges into Excel Tables (Ctrl + T). Tables use structured references (like [CustomerID]) instead of cell coordinates (like A2). This makes your formulas much easier to read and ensures that as you add new rows to your list, the formulas expand automatically without needing to be dragged down manually.

Troubleshooting

If your formula is returning "Not Found" even though you can clearly see the value exists in the other list, the most likely culprit is hidden spaces. A cell containing "ID123 " (with a trailing space) is not the same as "ID123". To fix this, you can wrap your lookup value in the TRIM function: MATCH(TRIM(A2), $E$2:$E$100, 0). This removes all leading and trailing spaces before the match is attempted.

Another common issue is data type mismatch. This happens when one list stores numbers as "Numbers" and the other stores them as "Text." Even if they look identical, Excel treats them differently. You can check this by using the =ISNUMBER() function on both cells. If one is TRUE and the other is FALSE, you must convert one column to match the other. You can do this by selecting the column, going to the Data tab, selecting Text to Columns, and clicking Finish immediately to force a format refresh.

If the formula returns a #VALUE! error, check your parentheses. Every opening parenthesis ( must have a corresponding closing parenthesis ). In the IF/ISERROR/MATCH stack, you have three opening parentheses, so you must have three closing ones at the end of your formula. If you are missing one, Excel cannot calculate the logic.

Frequently Asked Questions

Can I use this to compare two different sheets?

Yes. When selecting the lookup array, simply click over to the second sheet and highlight the range. Excel will automatically add the sheet name to the formula, looking something like 'Sheet2'!$E$2:$E$100.

What is the difference between ISERROR and ISNA?

ISERROR catches every type of error (#REF!, #VALUE!, #DIV/0!, etc.). ISNA only catches the #N/A error. Since MATCH specifically returns #N/A when a value is missing, ISNA is technically more precise, but ISERROR is more commonly used for general safety.

Will this formula slow down my computer?

For a few thousand rows, no. However, if you have tens of thousands of MATCH formulas, your workbook may lag. In those cases, using a Pivot Table or the Power Query "Merge" feature is more efficient than using cell-based formulas.

Can I return a value from another column instead of just "Found"?

If you want to pull actual data (like a phone number) instead of just a status, you should use VLOOKUP or XLOOKUP. The IF/ISERROR/MATCH combination is specifically designed for checking existence, not retrieving data.

Does the order of the list matter?

As long as you use 0 as the match_type, the order does not matter. The list can be randomized, sorted, or completely unsorted, and the formula will still find the exact match.