← All how-to recipes

How to sum where another column is not blank

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Total only the rows that have something in a companion column — completed, dated, assigned.

The formula

AppFormulaNotes
Excel (desktop)=SUMIF(A2:A6,"<>",B2:B6)"<>" alone means "not empty". The inverse (only blanks): =SUMIF(A2:A6,"",B2:B6).
Google Sheets=SUMIF(A2:A6,"<>",B2:B6)Identical.
LibreOffice Calc=SUMIF(A2:A6,"<>",B2:B6)Identical.

How it works

The bare "<>" criterion matches any non-empty cell, so only rows whose A-column is filled contribute: 100 + 25 + 10 = 135, while the amounts beside empty cells are skipped. Handy for "sum only invoiced items" (date column filled) or "only assigned tasks". One caveat: a formula returning "" looks blank but counts as NOT blank here — filter on the underlying condition instead when your status column is formula-driven.

Verified, not just documented

We ran =SUMIF(A2:A6,"<>",B2:B6) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 135 — 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 135 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

SUMIF — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons