← All how-to recipes

How to sum values where a checkbox is checked

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

Total only the ticked rows — selected expenses, chosen items, approved amounts.

The formula

AppFormulaNotes
Excel (desktop)=SUMIF(A2:A100,TRUE,B2:B100)A = checkbox column (TRUE/FALSE), B = amounts.
Google Sheets=SUMIF(A2:A100,TRUE,B2:B100)Identical.
LibreOffice Calc=SUMIF(A2:A100,TRUE(),B2:B100)Same idea; LibreOffice writes the boolean criterion as TRUE().

How it works

Checkboxes store TRUE/FALSE, so SUMIF with TRUE as the criterion totals just the ticked rows: 100 + 25 = 125. Since TRUE behaves as 1, =SUMPRODUCT(A2:A100*B2:B100) gives the same answer and extends naturally to more conditions. Pair with the count-checked-checkboxes recipe for a live "3 selected · $125" summary line.

Verified, not just documented

We ran =SUMIF(A2:A4,TRUE(),B2:B4) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 125 — 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 125 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 · TRUE — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons