How to make a formula return blank instead of zero
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Keep a results column clean — show nothing (not 0) when there's no data or the inputs are empty.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =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. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 20 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
IF — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to compare two columns row by row
- How to concatenate cells that meet a condition (TEXTJOIN IF)
- How to convert Yes/No (or TRUE/FALSE) to 1 and 0
- How to fill blank cells with the value above
- How to find duplicate values in a column