FormulaCraft

How to return blank instead of zero in Excel and Google Sheets

Topic:IF, IFS & nested conditions
Excel & Google Sheets
=IF(A2-B2=0,"",A2-B2)

Verified example

Computed by a real spreadsheet engine on the sample data below.

Value AValue BDifference
100100
150100
7575
200120

=IF(A2-B2=0,"",A2-B2)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Identify the formula that might return zero. For example, =A2-B2 returns 0 when A2 equals B2.
  2. 2Wrap it in an IF test: =IF(A2-B2=0,"",A2-B2). The empty string "" produces a truly blank cell rather than zero.
  3. 3Press Enter. Cells where the formula would have returned 0 now appear blank, while non-zero values display normally.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Will the blank cell cause problems in SUM or AVERAGE formulas?

No. SUM and AVERAGE ignore empty strings ("" returned by IF) just as they ignore truly blank cells.

How do I return blank instead of zero for any formula result?

Wrap any formula: =IF(your_formula=0,"",your_formula). To avoid calculating twice, you can use LET in Excel: =LET(v,your_formula,IF(v=0,"",v)).

More on IF, IFS & nested conditions

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: