Contact

COUNTIFS Function (Gnumeric)

Math Beginner Gnumeric

Count aligned rows meeting multiple criteria in Gnumeric COUNTIFS, with quoted conditions, cell-driven thresholds and mismatch checks.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

COUNTIFS counts positions where every supplied range/criterion pair matches. The conditions are combined as AND tests on corresponding positions. It does not add independent counts from different ranges. Repeated category entries can contribute separate matching rows.

Supply one or more pairs in range-then-criterion order. Text labels and operator expressions require quoted strings; an operator can be joined to a cell value using &. Keep every range aligned to the same records with matching dimensions. The implementation validates paired argument structure before invoking the shared criteria evaluator.

Syntax

COUNTIFS(range1, criterion1, [range2, criterion2], ...)

Worked examples

Row A (Quantity) B (Amount) C (Category)
1 1 10 apple
2 2 20 pear
3 3 30 apple
4 4 40 pear
5 5 50 apple

The preserved original =COUNTIFS(C1:C5,"apple",B1:B5,">20") returns 2, selecting rows 3 and 5 with apple amounts 30 and 50. The second original =COUNTIFS(C1:C5,"pear",B1:B5,">30") returns 1 because only the pear amount 40 qualifies.

Put 20 in G1. =COUNTIFS(C1:C5,"apple",B1:B5,">"&G1) also returns 2. The operator is quoted text, while the threshold comes from the referenced cell. The string “>G1” would not construct that comparison.

=COUNTIFS(C1:C5,"plum") returns 0. Zero is a valid count, but does not prove the labels or ranges are correct. Inspect source values and endpoints if no matches are unexpected.

Advanced use

List the expected matching row numbers before relying on a summary. Here rows 3 and 5 provide a manual check of the apple threshold. When copying formulas, keep each range anchored to matching start and end rows. Equal dimensions do not prevent a shifted range from pairing unrelated records.

An OR requirement needs another construction or separate disjoint counts. Adding overlapping counts can count a row twice, so examine overlap first. COUNTIFS also does not decide whether duplicate records are accidental; it counts positions provided by the dataset.

Errors and troubleshooting

COUNTIFS(C1:C5,“apple”,B1:B4,">20") returns #VALUE! in the mismatch check. Repair alignment rather than shortening data until a formula happens to run. Criteria tip: Text conditions often need quotes; operators combined with cell references should be constructed carefully. Keep the criterion ranges aligned with the corresponding values.

These examples use literal labels and numeric comparisons. They do not establish every wildcard, locale-specific coercion or error-selector behavior. Gnumeric formulas here use commas. COUNTIFS counts matching rows rather than summing their amounts.

Availability and verification

  • Introduced: Gnumeric 1.12.32, explicitly listed among new functions in official NEWS.
  • Historical source availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-math function module must be included and enabled.
  • Historical check: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.

The selected examples and errors were recalculated with the actual Gnumeric 1.12.57 engine under C.UTF-8 on 17 October 2026. Native workbooks and observed outputs are retained. No GUI array-entry behavior, retirement date or last-functioning release is established. Historical 1.12.62 registration is separate from the pinned 1.12.57 implementation.

For the related operations discussed here, see COUNTIF, SUMIF, SUMIFS.

ABS ROUND ROUNDUP ROUNDDOWN MOD.

Official references