How to Replace #VALUE! Error from SEARCH Function in Excel
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.

- 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.
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.
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.
Click on the cell where you want the search result to be displayed.
Type the formula =IFERROR(SEARCH("XYZ", A1), 0), replacing "XYZ" with your specific search term and A1 with the cell you are searching within.
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 ISNUMBER and IF to Output Specific Cell Contents
Combine IF, ISNUMBER, and SEARCH to perform conditional checks. This allows you to return a specific cell's value when the text is found, and a default value when it is not.
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. Open your data file: Launch WPS Spreadsheet and open the document containing the #VALUE! errors.
- 2. Apply the IFERROR formula: Select the cell with the error and type =IFERROR(SEARCH("text", A1), 0).
- 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.

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!.




