Home  /  Blog  /  Logical & Conditional
Logical & Conditional

Return Blank Instead of Zero in Excel (IF Formula)

By admin 26 November 2026 Logical & Conditional

Your report is full of zeros — in rows where nothing has been entered yet, in a subtraction that came out even, in a division by an empty cell. The zeros are not wrong, exactly, but they make the sheet look unfinished, and they hide the rows that actually have data. The fix is two double quotes with nothing between them, "", inside an IF formula: when the answer would be zero, Excel shows a blank cell instead. This guide gives you that formula first, works it through on three real cases — zero, no data yet, and an error — and then tells you the one thing the other guides bury: a cell that looks blank because of "" is not really empty, and the next formula you write needs to know that.

Quick takeaway: two double quotes, "", is the whole trick.

  • Blank instead of zero: =IF(A2-B2=0,"",A2-B2)
  • Blank until data is entered: =IF(A2="","",A2*0.05)
  • Blank instead of an error: =IFERROR(A2/B2,"")
  • "" looks blank but is NOT empty — ISBLANK returns FALSE on it.
  • To test for it, use =B2="", not ISBLANK.
Return Blank Instead of Zero in Excel (IF Formula)

The Formula — IF With an Empty String

=IF(A2-B2=0, "", A2-B2)
  • IF checks a condition and returns one value if it is true, another if it is false.
  • A2-B2=0 is the condition: is the answer zero?
  • “” is what to return if it is — two double quotes with nothing between them. To Excel this is an “empty string”, and the cell appears blank.
  • A2-B2 is what to return if it is not — the real answer.

A formula cannot truly delete a cell’s contents. It can only make the cell appear empty by returning an empty string. That distinction matters, and it gets its own section below.

Worked Example 1 — Blank Instead of Zero

Inventory: stock received in A, stock sold in B, remaining in C with =IF(A2-B2=0,"",A2-B2):

Stock Received (A)Stock Sold (B)Remaining (C)
100100blank
805030
6060blank

Check it: 100 − 100 = 0, so C2 shows blank. 80 − 50 = 30, so C3 shows 30. 60 − 60 = 0, so C4 shows blank. The zeros are gone, and the rows with stock left stand out.

The same pattern works for profit: selling price in D, buying price in C, profit =IF((D2-C2)=0,"",(D2-C2)). Sell for 500, bought for 500 → blank. Sell for 600, bought for 500 → 100.

Worked Example 2 — Blank Until Data Is Entered

This is the most common use. A commission column that should stay blank until a sales figure is typed in:

=IF(A2>0, A2*0.05, "")
Sales (A)Commission 5% (B)
100050
(blank)blank
50025
0blank
2000100

Check it: 1000 × 5% = 50. The blank row stays blank — no 0 sitting in it. 500 × 5% = 25. A typed 0 also gives blank, because 0 is not greater than 0. And 2000 × 5% = 100.

The other way to write the same test: =IF(A2="","",A2*0.05) — if A2 is empty, return blank, otherwise calculate. Or with ISBLANK: =IF(ISBLANK(A2),"",A2*0.05). All three do the same job; pick the one you find easiest to read.

Worked Example 3 — Blank Instead of an Error

Dividing by an empty cell gives #DIV/0!. Wrap the formula in IFERROR:

=IFERROR(A2/B2, "")

100 / 4 = 25. 100 / 0, or 100 / (an empty cell), gives blank instead of #DIV/0!. The error is gone, and so is the ugly message in the report.

One warning: IFERROR hides every error, including real mistakes in your formula — a wrong reference, a #NAME? from a typo. If you only want to hide #N/A, use IFNA instead: =IFNA(VLOOKUP(...),""). IFNA catches only #N/A and lets every other error show, so a real mistake is still visible. The same advice appears in the XLOOKUP vs VLOOKUP guide.

Blank If Negative, and the Reverse — Zero If Negative

The same IF pattern handles a negative result. Profit that should never show as a loss:

=IF((D2-C2)<0, "", D2-C2)

Sell for 400, bought for 500 → −100 → blank. Sell for 600, bought for 500 → 100.

And the reverse direction, which the group keywords also ask for — show 0 instead of a negative number, so a balance never goes below zero:

=MAX(0, A2-B2)

MAX returns the larger of 0 and the answer. 80 − 50 = 30, so MAX gives 30. 40 − 60 = −20, so MAX gives 0. No IF needed, and the cell holds a real number, not text.

And the other reverse — 0 instead of blank, when a downstream formula needs a number:

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

If A2 is empty, the cell holds 0. If A2 has a value, it holds that value.

The Trap — “” Looks Blank but Is NOT Empty

This is the section that saves you from the next mistake. A cell holding "" looks empty. It is not empty. It holds a text string with zero characters, and Excel treats it as text.

Test it yourself. B2 holds =IF(A2="","",A2*0.05) and A2 is blank, so B2 looks empty. Now test it:

TestResultWhy
=ISBLANK(B2)FALSEISBLANK only returns TRUE for a truly empty cell — one with no formula and no value
=B2=""TRUEThis is the correct test for a “” cell
=COUNTA(B2:B6)Counts the “” cellsCOUNTA counts every non-empty cell, and “” counts as non-empty
=SUM(B2:B6)Correct totalSUM ignores text, so “” does not change a sum
=AVERAGE(B2:B6)Correct averageAVERAGE ignores text too

So: SUM and AVERAGE are safe with “” cells. COUNTA is not — a range with 3 numbers and 2 “” cells gives COUNTA = 5, not 3. And any formula that tests ISBLANK on a “” cell gets FALSE. If you need to test for it, use =B2="".

If you need the cell to be truly empty, a formula cannot do it — only deleting the formula, or clearing the cell, makes it truly empty. The custom format below hides zeros without putting any text in the cell at all.

The Other Way — Hide Zeros With a Custom Format

If you do not want to change any formula, you can hide the zeros by formatting. Select the cells, right-click → Format Cells → Custom, and type:

0;-0;;@

A number format has four sections, separated by semicolons: positive; negative; zero; text. 0;-0;;@ shows positive numbers normally, negative numbers normally, shows nothing for zero, and shows text normally. The zeros disappear, the values are still there, and the cells are still truly numbers — SUM, AVERAGE, COUNTA and ISBLANK all behave exactly as before.

Do not use ;;; for this. Three semicolons with nothing between them hides everything — numbers, text, all of it. The 0;-0;;@ version hides only the zeros.

Use the format when the whole column should never show a zero. Use the IF formula when only some cells should be blank, or when the blank depends on a condition.

Common Mistakes

MistakeWhat happensFix
You typed "" with a space inside (" ")The cell shows a space, not a blank — and it is not empty eitherTwo quotes, nothing between them: ""
You used single quotes ('')Excel does not recognise them — the formula breaksDouble quotes only: ""
You tested a “” cell with ISBLANKFALSE — ISBLANK only works on truly empty cellsTest with =B2=""
Your COUNTA is too high after adding blanksCOUNTA counts “” cells as non-emptyUse COUNT for numbers, or COUNTIF with "<>" for text
You used IFERROR to hide #DIV/0!It hides real mistakes tooUse IFNA for #N/A only, or test the divisor first: =IF(B2=0,"",A2/B2)
You used ;;; as the custom formatEverything is hidden, not just the zerosUse 0;-0;;@ to hide only zeros
You wanted a truly empty cellA formula cannot make one — “” is textDelete the formula, or clear the cell

Frequently Asked Questions

How do I return blank instead of zero in Excel? Use =IF(A2-B2=0,"",A2-B2). If the answer is zero, the cell shows blank. Otherwise it shows the answer.

How do I make a formula return blank if there is no data? Use =IF(A2="","",A2*0.05). If A2 is empty, the cell stays blank until you type a number.

How do I return blank instead of #DIV/0!? Use =IFERROR(A2/B2,""). Or test the divisor first: =IF(B2=0,"",A2/B2).

Is a cell with “” really empty? No. It holds an empty text string. ISBLANK returns FALSE on it, and COUNTA counts it. Test it with =B2="" instead.

Why is my COUNTA wrong after adding blanks? Because COUNTA counts “” cells. Use COUNT for numbers, or COUNTIF with "<>" for text.

How do I hide zeros without changing the formula? Select the cells, Format Cells → Custom, type 0;-0;;@. The zeros disappear and the values stay as real numbers.

How do I show 0 instead of a negative number? Use =MAX(0,A2-B2). The answer never goes below zero.

How do I show 0 instead of blank? Use =IF(A2="",0,A2). An empty A2 gives 0; a value in A2 gives that value.

That is the whole method: two double quotes inside an IF, and the cell shows blank instead of zero, instead of an error, or until the data arrives. It works for inventory, commission, profit and division, and the only case that needs extra care is the one the trap section covers — a blank-looking cell is text, not empty, so test it with ="" and count it with COUNT, not COUNTA. When you would rather hide the zeros without touching any formula, the custom format 0;-0;;@ does it in one step. Try it on your own sheet now, with the commission table above, and when the condition itself is the point — when a cell should show one thing if a test passes and another if it fails — the next guide to read is the absolute reference guide, which is the other half of writing formulas that survive being copied down a column.


About admin

Author of Excel formula guides on this blog.

View all guides by admin →

Keep Learning

Related guides

How to Use IF and IFS in Excel

IF lets Excel make decisions for you. In this demo guide, you will learn the syntax =IF(logical_test, value_if_true, value_if_false) and how IFS...

=IF(logical_test, value_if_true, value_if_false)
Read Guide →