Formula Errors

Excel Formula to Return a Number Unless Cells Contain Text or Errors

Phi Hung VoPhi Hung Vo Nov 18, 2026 869 views

Question details

Create an Excel formula that returns a number only when C37, C35, and C38 contain valid numeric inputs.

Return a Number in Excel Unless Cells Contain Text or Errors
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.
Before you start

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.

Solution 1Recommended

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.

1
Select an output cell

In Excel, click a cell other than C37, C35, or C38 where you want the result to appear.

2
Enter the formula

Type =IFERROR(IF(AND(ISNUMBER(C37),ISNUMBER(C35),ISNUMBER(C38)),SUM(C37,C35,C38),""),"") in the formula bar and press Enter.

3
Adapt the calculation

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.

4
Test the result

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 the input cells with ISNUMBER and IFERROR
Blank cells are excluded: ISNUMBER returns FALSE for blank cells and numbers stored as text, so the example also returns a blank in those cases. The empty string makes the output look blank, but the cell still contains a formula.
Work with formulas in WPS Spreadsheets

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. 1. Open the workbook: In WPS Spreadsheets, choose Open and select your Excel workbook.
  2. 2. Choose an output cell: Click a cell other than C37, C35, or C38.
  3. 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. 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. 5. Save the workbook: Choose File > Save As and select the Excel XLSX format if you want to keep an Excel-compatible copy.
Check C37, C35, and C38 for numeric inputs before calculating.Open and save Microsoft Excel XLSX files.Use a familiar spreadsheet interface to edit and test formulas.
microsoft office alternative - wps office

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.