← All how-to recipes

How to COUNTIF across multiple columns

✓ Verified in LibreOffice 25.8.7.3

Count matches in a whole grid, not just one column.

The formula

AppFormulaNotes
Excel=COUNTIF(A2:C10,"yes")COUNTIF happily takes a 2-D range — this is all it needs.
Google Sheets=COUNTIF(A2:C10,"yes")Identical.
LibreOffice Calc=COUNTIF(A2:C10,"yes")Identical.

How it works

COUNTIF's range can be any rectangle — it scans every cell in the 3×3 grid and finds four "yes" values. The limitation people then hit: COUNTIFS requires all its criteria ranges to be the SAME shape, so you can't mix a 2-D range with a 1-D condition. For "count rows where ANY column says yes", use =SUMPRODUCT(--(COUNTIF(OFFSET(...)...))) patterns or simply add per-column COUNTIFS. Wildcards and comparisons work exactly as in the single-column case.

Verified, not just documented

We ran =COUNTIF(A2:C4,"yes") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 4 — exactly the expected result. Every formula here is confirmed by actually executing it.