Excel Formula to Return a Number Unless Cells Contain Text or Errors
Question details
Create an Excel formula that returns a number only when C37, C35, and C38 contain valid numeric inputs.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet calculation depends on the values in C37, C35, and C38.
- Observed behavior
- The desired result is a number for valid inputs and a blank result when a required cell contains text or an error.
Identify the calculation you want to perform with C37, C35, and C38, and choose an output cell outside those three cells. Decide what to display for invalid inputs; the example below uses an empty string.
Check the input cells with ISNUMBER and IFERROR
Use this approach to exclude text, errors, and blank inputs before running a numeric calculation.
ISNUMBER checks that each required cell contains a number. IFERROR returns a blank if the calculation itself produces an error.
In Excel, click a cell other than C37, C35, or C38 where you want the result to appear.
Type =IFERROR(IF(AND(ISNUMBER(C37),ISNUMBER(C35),ISNUMBER(C38)),SUM(C37,C35,C38),""),"") in the formula bar and press Enter.
In the formula bar, replace SUM(C37,C35,C38) with your original calculation, making sure it returns a number for valid inputs. Keep the surrounding ISNUMBER checks and IFERROR wrapper.
Enter numbers in C37, C35, and C38 to check the numeric result. Then temporarily enter text or an error in one input cell and verify that the output appears blank.

Check Numeric Inputs in WPS Spreadsheets
Use the same ISNUMBER and IFERROR formula in WPS Spreadsheets to calculate a result only when the required cells contain numbers.
- 1. Open the workbook: In WPS Spreadsheets, choose Open and select your Excel workbook.
- 2. Choose an output cell: Click a cell other than C37, C35, or C38.
- 3. Enter the formula: In the formula bar, enter =IFERROR(IF(AND(ISNUMBER(C37),ISNUMBER(C35),ISNUMBER(C38)),SUM(C37,C35,C38),""),"") and press Enter.
- 4. Adjust and test: Replace SUM(C37,C35,C38) with your numeric calculation, then test the formula by entering numbers and text in the input cells.
- 5. Save the workbook: Choose File > Save As and select the Excel XLSX format if you want to keep an Excel-compatible copy.

Frequently Asked Questions
Why does the formula return a blank when an input cell is empty?
ISNUMBER returns FALSE for an empty cell. The IF function therefore returns the empty string specified by "". Enter a number in each required input cell to calculate the result.
Can I show a message instead of a blank?
Yes. Replace the relevant "" in the formula with a message such as "Invalid input". You can use different messages for the IF and IFERROR results.
Will IFERROR alone prevent text in the input cells?
Not necessarily. IFERROR catches calculation errors but does not directly test whether each input is numeric. Use ISNUMBER on C37, C35, and C38 to exclude text.
Why is a number stored as text rejected?
ISNUMBER treats a text value such as "12" as nonnumeric. Convert the cell to a real number, for example by selecting it and using Excel's error indicator to choose Convert to Number when that option appears.




