[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (2025)

Fix 1 – Fix Formula Result Showing 0 by Converting Text to Number

You’ll need to check the data in the dataset that is being used in the formulas. Sometimes, the numbers are stored in text format and the formula returns 0 instead of the actual result.

Case 1.1 – Convert Text to Number with Mouse Click

In the following screenshot, we have a dataset of a bookstore. The dataset consists of the names of some books and the available quantity of those books in that bookstore. Suppose we want to calculate the number of total books in cell C10.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (1)

Setup:

  • Input the formula in cell C10 to calculate the total quantity:

=SUM(C5:C9)

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (2)

  • Press Enter and we can see that the formula returns 0. This is the problem that we need to fix.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (3)

  • In cell F6 insert the following formula:

=COUNTA(C5:C9)

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (4)

  • If you press Enter after inserting the formula, you get the result because the COUNTA function counts the number of non-blank cells. It doesn’t look at the cell values.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (5)

  • Insert the following formula in cell F7:

=COUNT(C5:C9)

  • Press Enter. Here the formula returns 0 because the COUNT function counts the number of cells that contain numbers, not text.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (6)

  • We can see the numbers in the cell but there is an invisible apostrophe that indicates the number is in text format, which can only be seen in the formula bar. That is why we get an error while using formulas.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (7)

Steps:

  • Select the cells (C5:C9).

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (8)

  • Click on the exclamation.A drop-down menu will appear.
  • Select the option Convert to Numberfrom the drop-down menu.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (9)

  • We can see that the formula result no longer shows a zero value in cells C10 and F7.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (10)

Case 1.2 – Use the Paste Special Option to Convert Text to Numbers

To illustrate this method, we will use the same dataset that we used in the previous method.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (11)

Steps:

  • Select any cell outside the data range and click on Copy.
  • Select the cell range (C5:C9).
  • Go to Home, selectPaste, and choose Paste Special

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (12)

  • This opens a new dialogue box named Paste Special.
  • Check the option Add under the Operation section and click on OK.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (13)

  • The expected output of the formula is now in cell C10.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (14)

Case 1.3 – Apply VBA Code to Convert Text to Number to fix formula result showing 0 in Excel

We’ll use the same dataset to show VBA code use.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (15)

Steps:

  • Select cells C5:C9.
  • Right-click on the active sheet.
  • Select the option View Code.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (16)

  • This will open a blank VBAmodule.
  • Insert the following code in that module:
Sub TextToNumber()Dim rg As RangeOn Error Resume NextSet rg = Selection _.SpecialCells(xlCellTypeConstants, 23)On Error GoTo ErrorHandleIf Not rg Is Nothing ThenCells.SpecialCells(xlCellTypeLastCell) _.Offset(0, 1).Copyrg.PasteSpecial Paste:=xlPasteValues, _Operation:=xlPasteSpecialOperationAddElseMsgBox "Unable to find Constants in selection"End IfHandler_Exit:Application.CutCopyMode = FalseSet rg = NothingExit SubErrorHandle:MsgBox "Unable to convert text to numbers"Resume Handler_ExitEnd Sub
  • Click on the Run button or press the F5 key to run the code.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (17)

  • The code converts the text values into numbers, fixing the issue.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (18)

Fix 2 – Fix Formula Result Is Showing 0 in Excel Using the Text to Column Option

We will use the same dataset as before.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (19)

Steps:

  • Select the cells C5:C9.
  • Go to the Data tab.
  • Select Text to Columns from the Data Toolssection.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (20)

  • A new dialogue box will appear. Check the option Delimited from the file type options and click on the Finishbutton.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (21)

  • The above action returns the result of the formula in cell C10.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (22)

Fix 3 – Remove Hidden Characters When Formula Result Showing 0 in Excel

Another reason for the formula result showing 0 in Excel is the presence of hidden characters in the formula range.

Case 3.1 – Fix Formula Result Showing 0 By Removing Hidden Characters Using Character Codes

In Microsoft Excel, the character code for a non-breaking space is 0160. We have to replace those characters with blank or empty strings. The following dataset of a bookstore consists of the names of different books and their all-time sales quantity from that store.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (23)

Steps:

  • Select the cells C5:C8.
  • Go to the Hometab.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (24)

  • Go to the Find & Select option.
  • Select the option Replace.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (25)

  • A new dialogue box named Find and Replacewill appear.
  • Go to the Find whattext field. Hold the Alt key and type 0160 on the number keypad (not from the alphanumeric keys). You won’t be able to see the character.
  • Keep the Replace withtext field empty.
  • Click on Replace All.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (26)

  • A new dialogue box appears which shows the number of replacements that have been made. Click OK.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (27)

  • This will replace hidden characters with empty strings from the range. We’ll get the expected output of the formula in cell C9.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (28)

Case 3.2 – Insert VBA Code to Remove Hidden Characters to Fix Formula Result Showing 0 in Excel

We’ll use the same dataset to showcase the VBA code.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (29)

Steps:

  • Select the cell range C5:C8.
  • Right-click on the active sheet and select the option View Code.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (30)

  • This will open a blank VBAmodule.
  • Insert the following code in that module:
Sub RemoveCode160()Dim rng As RangeDim vrn As VariantDim i As LongSet rg = SelectionIf rg.Cells.Count = 1 ThenReDim vrn(1 To 1, 1 To 1)vrn(1, 1) = rg.ValueElsevrn = rg.ValueEnd IfFor i = 1 To UBound(vrn, 1)vrn(i, 1) = Replace(vrn(i, 1), Chr(160), "")Next irg.Value = vrnEnd Sub
  • Click on the Run button or press the F5key.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (31)

  • The code replaced all the hidden characters and returned the output of the formula in cell C9.

[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (32)

Download the Practice Workbook

Formula Result Showing 0.xlsm

Related Articles

  • How to Display Cell Formulas in Excel
  • How to Show All Formulas in Excel
  • Why Excel Shows Formulas Instead of Results
  • How to Show Formula in Cells Instead of Value in Excel
  • How to Show Value Instead of Formula in Excel
  • How to Show Formula as Text in Another Cell in Excel
  • How to Show Formulas When Printing in Excel

<< Go Back To Show Excel Formulas | Excel Formulas | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
[Fixed!] Formula Result Showing 0 in Excel (3 Solutions) - ExcelDemy (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Horacio Brakus JD

Last Updated:

Views: 5728

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Horacio Brakus JD

Birthday: 1999-08-21

Address: Apt. 524 43384 Minnie Prairie, South Edda, MA 62804

Phone: +5931039998219

Job: Sales Strategist

Hobby: Sculling, Kitesurfing, Orienteering, Painting, Computer programming, Creative writing, Scuba diving

Introduction: My name is Horacio Brakus JD, I am a lively, splendid, jolly, vivacious, vast, cheerful, agreeable person who loves writing and wants to share my knowledge and understanding with you.