Formula Errors

How to Replace #VALUE! Error from SEARCH Function in Excel

Phi Hung VoPhi Hung Vo Nov 11, 2026 869 views

Question details

The user wants to replace the #VALUE! error that occurs when the SEARCH function fails to find a specific text string within a cell.

How to Replace a #VALUE! Error from SEARCH in an Excel Formula
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Using the SEARCH function to locate specific text, but needing a clean numerical or text output instead of an error message when the target text is missing.
Observed behavior
The SEARCH function returns a #VALUE! error when the requested text is not found, which disrupts data presentation and breaks subsequent formula calculations.
Before you start

Identify the exact text string you are searching for and determine what default value (such as 0, a blank space, or specific text) you want to display when the target text cannot be found.

Solution 1Recommended

Use IFERROR to Replace the #VALUE! Error with a Custom Output

Wrap your existing SEARCH formula within an IFERROR function to automatically output a default value, like 0, whenever the text is not found.

The IFERROR function is the most direct way to intercept errors in Excel formulas. When the SEARCH function fails to locate the specified string, it triggers a #VALUE! error. IFERROR catches this exact error and substitutes it with whatever alternative value you define.

1
Select your target cell

Click on the cell where you want the search result to be displayed.

2
Enter the IFERROR formula

Type the formula =IFERROR(SEARCH("XYZ", A1), 0), replacing "XYZ" with your specific search term and A1 with the cell you are searching within.

3
Apply the formula

Press Enter. The cell will now display the starting position of the text if found, or a 0 if the text is missing, completely eliminating the #VALUE! error.

Use IFERROR to Replace the #VALUE! Error with a Custom Output
Returning a Blank Cell: If you prefer the cell to appear empty instead of showing a 0, replace the 0 in the formula with empty double quotes like this: =IFERROR(SEARCH("XYZ", A1), "").
Advanced Formula Support

Handle Complex Formulas Easily with WPS Spreadsheet

WPS Spreadsheet fully supports advanced error-handling formulas like IFERROR, ISNUMBER, and SEARCH. You can seamlessly process large datasets, clean up errors, and manage complex data logic completely free of charge.

  1. 1. Open your data file: Launch WPS Spreadsheet and open the document containing the #VALUE! errors.
  2. 2. Apply the IFERROR formula: Select the cell with the error and type =IFERROR(SEARCH("text", A1), 0).
  3. 3. Drag to fill: Click and drag the small square at the bottom-right of the cell down the column to automatically fix the formula for all remaining rows.
100% compatible with Microsoft Excel formulas, functions, and file formats (.xlsx).Intuitive formula builder with built-in error-checking and syntax highlighting.Lightweight application that processes large datasets quickly without freezing.Familiar user interface makes migrating from Microsoft Office effortless.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the SEARCH function return a #VALUE! error?

The SEARCH function calculates and returns the numerical starting position of a text string within a cell. If the specified text does not exist in that cell, the function cannot output a valid position, resulting in a #VALUE! error.

What is the difference between FIND and SEARCH when handling missing text?

Both FIND and SEARCH are used to locate text and both will return a #VALUE! error if the text is missing. The primary difference is that FIND is case-sensitive, whereas SEARCH ignores capitalization. You can use the exact same IFERROR logic to handle errors for both functions.

Can I use IFERROR with other Excel functions?

Yes. The IFERROR function is highly versatile and can wrap around almost any Excel formula, such as VLOOKUP, INDEX/MATCH, or division operations, allowing you to gracefully catch and replace errors like #N/A, #DIV/0!, and #REF!.