How to Fix Excel SUM Returning Zero for IF Formula Results
Question details
The user needs to calculate the total of numerical values returned by an IF formula, but the SUM function is returning a zero result.

- Product
- Microsoft Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Attempting to add up conditionally generated numerical results from a nested IF function using the SUM function.
- Observed behavior
- The SUM function ignores the IF formula's output values (such as 0, 1, and 3) and returns 0 because the numbers are enclosed in quotation marks, which causes the spreadsheet to treat them as text rather than numerical data.
Check the cells containing your IF formulas to see if the resulting numbers are aligned to the left, which typically indicates they are formatted or stored as text rather than numerical values.
Remove Quotation Marks from IF Formula Outputs
The most direct and effective way to resolve this error is to modify the IF formula so it outputs actual numbers rather than text strings.
When you wrap a number in quotation marks (e.g., "1") within a formula, the spreadsheet application treats it as a text string. The SUM function is specifically designed to ignore text strings, which is why it returns a zero total even if the text looks like a number.
Click on the cell containing your original IF formula to view it in the formula bar.
Delete the quotation marks around the numeric outputs in your logic. For example, change =IF(B5="Yes","0",IF(B5="No","3","")) to =IF(B5="Yes",0,IF(B5="No",3,"")).
Press Enter to save the changes, and then drag the fill handle at the bottom right corner of the cell down to apply this corrected formula to the rest of your column.

Use the VALUE Function to Convert Text to Numbers
If you cannot alter the original text-based output of the IF formula, you can use the VALUE function to convert the text strings into calculating numbers.
Fix Formula Errors Instantly with WPS Spreadsheet
WPS Spreadsheet offers a highly compatible and intuitive environment for handling complex formulas. With built-in error checking and seamless Microsoft Excel compatibility, you can easily spot and fix text-formatted numbers to ensure your calculations are always accurate.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing the SUM and IF formula errors.
- 2. Locate the formula: Click on the cell with the IF formula and navigate to the formula bar at the top.
- 3. Correct the syntax: Remove the quotation marks around your numerical outputs and press Enter.
- 4. Calculate the total: Select the cell at the bottom of your data and click the AutoSum button on the Home tab to get the correct total.

Frequently Asked Questions
Why does Excel treat numbers in quotation marks as text?
Quotation marks in Excel formulas are specifically used to denote text strings. Any number placed inside them (like "1" or "3") is read as a character string, not a mathematical value, meaning mathematical functions will skip over them.
Can I force the SUM function to add numbers formatted as text?
While the standard SUM function ignores text, you can use an array formula like =SUM(VALUE(A1:A10)) or the SUMPRODUCT function like =SUMPRODUCT(A1:A10*1) to force the text-to-number conversion directly within the calculation.
How do I quickly identify if my formula results are text or numbers?
By default, spreadsheet applications align text to the left side of a cell and numbers to the right. Additionally, you may see a small green triangle in the top-left corner of the cell indicating a 'Number Stored as Text' warning.
Does changing the cell format to 'Number' fix the issue?
No. Changing the cell format using the formatting menu will not alter the underlying data type generated by an IF formula that explicitly outputs text. You must modify the formula itself or use a conversion function like VALUE.




