← All how-to recipes

How to make a formula return blank instead of zero

✓ Verified in LibreOffice 25.8.7.3

Keep a results column clean — show nothing (not 0) when there's no data or the inputs are empty.

The formula

AppFormulaNotes
Excel=IF(A2="","",A2*B2)Guards on the empty input. To blank ANY zero result: =IF(A2*B2=0,"",A2*B2).
Google Sheets=IF(A2="","",A2*B2)Identical.
LibreOffice Calc=IF(A2="","",A2*B2)Identical.

How it works

The IF checks whether the source cell is empty: when A2 has data it does the calculation (5 x 4 = 20, as verified here), and when A2 is empty it returns "" instead of 0, leaving the cell looking blank. That keeps summary columns and charts tidy while a sheet is still being filled in. Two things to know: the "" result is TEXT that only LOOKS blank — ISBLANK reports it as non-empty, though SUM still ignores it. If you only want to hide zeros visually while keeping the real number underneath, use a custom number format (0;-0;;) or the display-zero-as-a-dash approach instead of changing the value.

Verified, not just documented

We ran =IF(A2="","",A2*B2) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 20 — exactly the expected result. Every formula here is confirmed by actually executing it.