Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=IF(A2-B2=0,"",A2-B2)Computed by a real spreadsheet engine on the sample data below.
| Value A | Value B | Difference |
| 100 | 100 | |
| 150 | 100 | |
| 75 | 75 | |
| 200 | 120 |
=IF(A2-B2=0,"",A2-B2)→
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.
No. SUM and AVERAGE skip text values, and "" is text — so totals and averages behave exactly as if the cell were empty.
When the looked-up cell is empty, VLOOKUP converts the blank to 0. Wrap it: =IF(VLOOKUP(D2,A:B,2,0)="","",VLOOKUP(D2,A:B,2,0)) — or use LET to avoid the double lookup.
No — it holds a zero-length text string. ISBLANK(A2) is FALSE, COUNTA counts it, and A2+1 errors. If those matters, hide zeros with the number format 0;-0;;@ instead, which keeps the underlying number.
Excel: File → Options → Advanced → untick "Show a zero in cells that have zero value". Google Sheets has no sheet-wide switch — use the custom number format 0;-0;;@ on the range instead.
"" plots as a gap in most chart types. In Excel, returning NA() instead makes line charts interpolate or skip the point cleanly; in Sheets, leave "" and enable "Plot null values" options per chart as needed.
Replace #N/A, #DIV/0!, and other errors with a blank or a friendly message using IFERROR or IFNA. Works in Excel and Google Sheets.
Error fixNested IF formulas not working in Excel and Google Sheets — fix bracket mismatches, wrong evaluation order, overlapping conditions, and the 64-nesting limit.
How-toCheck if a cell contains specific text with IF + ISNUMBER + SEARCH and return any value you want — plus case-sensitive checks, multiple keywords, and wildcard alternatives.
How-toUse SUMIF with wildcard criteria (*text*) to sum values in a column whenever a related column contains a specific substring.
How-toChain multiple IF functions inside each other to test several conditions and return different results for each scenario.
How-toCombine IF with AND or OR to test multiple conditions simultaneously and return a result based on whether all or any are true.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: