How to Fix Excel SUM Returning Zero for Numbers Stored as Text
Question details
The SUM function is returning a result of 0, despite the targeted cells containing visible numbers that have been formatted as numbers. This typically happens after data is imported or copied via a VBA macro.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating the total sum of a data range that contains imported data or VBA-generated outputs.
- Observed behavior
- The SUM function ignores the cell contents and evaluates to zero because the numbers are being treated as text strings by the spreadsheet application.
Verify whether your data is actually stored as text by selecting a cell and checking for a small green triangle in the upper-left corner, or by typing =ISNUMBER(A2) in an adjacent cell to see if it returns FALSE.
Convert to Numbers Using the Error Checking Smart Tag
The fastest way to fix numbers stored as text is by using the built-in error checking warning that appears next to the affected cells.
Spreadsheet applications often detect when a number is formatted as text and flag it with a small colored triangle in the corner of the cell. You can use the smart tag attached to this warning to instantly convert the data.
Highlight the entire range of cells containing the numbers that your SUM function is failing to calculate.
Look for a yellow warning icon with an exclamation mark that appears next to your selection and click it.
Select 'Convert to Number' from the drop-down menu. The text strings will be converted to actual numbers, and your SUM formula will instantly update with the correct total.

Batch Convert Text to Numbers via Text to Columns
If the error checking icon doesn't appear or you have a massive dataset, the Text to Columns feature can quickly process an entire column of text-based numbers.
Force Numeric Conversion Using Paste Special
Multiplying text values by 1 forces the spreadsheet to evaluate and mathematically convert them into actual numeric values.
Fix Number Formatting and Calculation Errors in WPS Spreadsheet
WPS Spreadsheet provides intuitive tools to instantly detect numbers stored as text and convert them in batch, ensuring your SUM functions calculate perfectly without complex workarounds.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing the broken SUM formulas.
- 2. Highlight the target cells: Select the range of cells that contain the numbers stored as text.
- 3. Convert to number: Click the floating warning icon next to the selection and choose 'Convert to Number'. Your SUM formula will automatically calculate the correct total.

Frequently Asked Questions
Why doesn't changing the cell format to 'Number' fix the SUM issue?
Applying a 'Number' format from the ribbon only changes how the cell visually displays its contents; it does not change the underlying data type. You must actively convert the text string into a numeric value using tools like 'Convert to Number' or 'Text to Columns' before the SUM function can process it.
How do I test if my cells contain numbers or text?
You can use the =ISNUMBER() or =ISTEXT() functions in an adjacent blank cell. For example, if you type =ISNUMBER(A2) and it returns FALSE, the value is stored as text and will be completely ignored by the SUM function.
How can I prevent my VBA macro from pasting numbers as text?
When writing data using VBA, ensure your macro assigns actual numeric values rather than text strings. You can use VBA conversion functions like CDbl() (for doubles) or CLng() (for longs) to convert your variables into numbers immediately before writing them to the worksheet cells.




