To handle "not found" results in Excel, use the IFERROR function or the XLOOKUP function's built-in "if not found" argument. These tools allow you to replace ugly error messages like #N/A, #VALUE!, or #REF! with a custom text string, a zero, or a blank cell, ensuring your spreadsheets remain professional and readable.

What You'll Need

  • A computer with Microsoft Excel installed (Office 365, Excel 2021, or later for XLOOKUP; older versions for IFERROR).
  • A dataset containing the values you wish to search for and a corresponding table or range where the data resides.
  • Basic familiarity with cell referencing (e.g., knowing that A2 refers to the cell in column A, row 2).

Step-by-Step

Depending on your version of Excel and the specific formula you are using, there are three primary ways to manage "not found" scenarios. Note that menu labels and function availability may differ slightly based on your version, device, or region.

Method 1: Using XLOOKUP (The Modern Way)

XLOOKUP is the most efficient method because it has a dedicated argument specifically for when a value is not found, removing the need for nested formulas.

  1. Click on the cell where you want the result to appear.
  2. Type =XLOOKUP( to begin the function.
  3. Select the lookup_value: This is the cell containing the value you are searching for (e.g., a product ID in cell A2).
  4. Type a comma, then select the lookup_array: This is the column or range where Excel should search for that value (e.g., Column G in your data sheet).
  5. Type a comma, then select the return_array: This is the column containing the information you want to retrieve (e.g., Column H, which contains the product prices).
  6. Type a comma, then enter the if_not_found value. If you want text, wrap it in quotation marks, such as "Not Found" or "Missing Data". If you want a number, simply type 0.
  7. Close the parenthesis ) and press Enter.

Method 2: Using IFERROR with VLOOKUP

If you are using an older version of Excel or prefer VLOOKUP, you must wrap the entire formula inside an IFERROR function to hide the #N/A error.

  1. Start your formula with =IFERROR(.
  2. Enter your standard VLOOKUP formula inside the parentheses. For example: VLOOKUP(A2, G:H, 2, FALSE).
  3. Type a comma after the VLOOKUP formula.
  4. Enter the value you want to display if the search fails. For example, "Not Found" or "" (two double quotes with nothing between them will leave the cell blank).
  5. Close the final parenthesis ) and press Enter.
  6. The full formula should look like: =IFERROR(VLOOKUP(A2, G:H, 2, FALSE), "Not Found").

Method 3: Using IFNA for Specificity

IFERROR catches every type of error (including formula typos). If you only want to handle "Not Found" (#N/A) errors but still want to know if your formula is broken (e.g., #REF! or #VALUE!), use IFNA.

  1. Type =IFNA(.
  2. Enter your lookup formula (VLOOKUP, HLOOKUP, or MATCH).
  3. Type a comma and enter your custom "not found" text, such as "Value Missing".
  4. Close the parenthesis and press Enter.

Common Mistakes

One of the most frequent errors is forgetting the quotation marks around text. In Excel formulas, any text that is not a function or a cell reference must be enclosed in double quotes. If you type =IFERROR(VLOOKUP(...), Not Found) without quotes, Excel will treat "Not Found" as a named range, fail to find it, and return a #NAME? error.

Another common mistake is using the wrong lookup match type in VLOOKUP. If you omit the final argument or set it to TRUE, Excel performs an approximate match. This can lead to the formula returning the wrong piece of data instead of triggering the "not found" logic. Always use FALSE (or 0) for exact matches when searching for specific IDs or names.

Users often confuse the order of arguments in XLOOKUP. Remember: Lookup Value → Where to look → What to return → What to do if missing. Swapping the lookup array and return array will cause the formula to search the wrong column, likely resulting in a "not found" result even when the data exists.

Tips

For a cleaner look, use a blank string "" as your "not found" value. This keeps the spreadsheet tidy, especially in large reports where hundreds of "Not Found" messages would create visual clutter.

If you are managing a massive dataset, consider using a Table (Ctrl + T) for your source data. By using structured references (like Table1[Price]) instead of cell ranges (like G2:G1000), your "not found" logic will automatically update as you add new rows to your data source.

Combine these functions with Conditional Formatting. For example, you can set a rule that highlights any cell containing the text "Not Found" in red. This allows you to quickly scan a sheet and identify exactly which records are missing from your database without reading every row.

Troubleshooting

If your formula is returning "Not Found" even though you can clearly see the value in your source table, check for leading or trailing spaces. A cell containing "Apple " (with a space) is not the same as "Apple". To fix this, you can wrap your lookup value in the TRIM function: =XLOOKUP(TRIM(A2), G:G, H:H, "Not Found").

If the formula returns #VALUE! instead of your custom "not found" text, you may have a syntax error in the formula itself. Check that every opening parenthesis has a matching closing parenthesis and that you have used commas to separate arguments correctly.

If you are using VLOOKUP and getting incorrect results instead of "not found," ensure your lookup column is the first column in the selected range. VLOOKUP can only search from left to right. If your lookup value is in the middle of the table, switch to XLOOKUP or INDEX/MATCH.

Frequently Asked Questions

Can I use a different formula as the "not found" result?

Yes. Instead of a text string like "Not Found", you can put another formula in the last argument. For example, you can tell Excel to perform a second lookup in a different table if the first one fails.

Does IFERROR slow down my spreadsheet?

In most standard spreadsheets, the performance impact is negligible. However, in sheets with tens of thousands of complex array formulas, nesting every single one in IFERROR can slightly increase calculation time.

What is the difference between #N/A and other errors?

#N/A specifically means "Not Available"—the value simply isn't there. Other errors like #VALUE! mean the formula has the wrong type of data, and #REF! means a cell reference is deleted. This is why IFNA is safer than IFERROR for data validation.

Can I leave the "if not found" part blank in XLOOKUP?

If you omit the if_not_found argument in XLOOKUP, Excel will default to returning the standard #N/A error if the value is missing.

Does this work on Excel for Web?

Yes, XLOOKUP, IFERROR, and IFNA are all supported in the web-based version of Microsoft Excel, as well as the desktop applications for Windows and macOS.