SUMIFS and COUNTIFS Formula Builder

Sum or count rows matching multiple criteria — no pivot table needed. Describe your conditions and get a working SUMIFS or COUNTIFS formula.

Files are processed locally and never uploaded.

How to use

  1. 1

    Describe your sum or count in the question box above — edit the example with your columns and criteria.

  2. 2

    Submit and get a working SUMIFS or COUNTIFS formula with each argument explained.

  3. 3

    Copy it into your spreadsheet and adjust the ranges to your data.

What SUMIFS and COUNTIFS actually do

SUMIFS adds up numbers only for rows matching all your criteria: =SUMIFS(C2:C1000, A2:A1000, "Q1", B2:B1000, "Online") sums column C where column A is Q1 AND column B is Online. COUNTIFS is the same shape without a sum range — it counts matching rows: =COUNTIFS(A2:A1000, "Q1", B2:B1000, "Online").

The mental model: they're a pivot table's sum and count, written as a single cell formula that recalculates live. For dashboards and summary rows, they replace a surprising amount of manual filtering and subtotaling.

The argument order trap

SUMIFS has a famously confusing signature: the sum range comes FIRST, then pairs of criteria-range and criteria. Its older sibling SUMIF puts the sum range LAST. Mixing them up is the #1 SUMIFS error — =SUMIFS(A2:A100, C2:C100, ">10") sums the wrong column entirely and looks correct until someone audits the numbers.

COUNTIFS is kinder (no sum range, just criteria pairs), but shares the second classic trap: every criteria range must be the same size and shape. =COUNTIFS(A2:A1000, "Q1", B2:B500, "Online") fails because the ranges differ — a mistake that's easy to make when columns grow at different rates. The generator keeps ranges aligned and explains each pair.

Criteria syntax: the part everyone Googles

Text criteria need quotes ("Online"), numbers don't (10000), and comparison operators go inside quotes as strings: ">10000", "<>West", "<="&TODAY(). Cell references concatenate with &: ">"&D1 sums everything above the threshold in D1. Wildcards work too: "*west*" matches any text containing "west" (case-insensitive).

Dates are the perennial headache: =COUNTIFS(D2:D1000, ">=2026-01-01") works, but comparing against a date stored as text doesn't — and imported CSVs love storing dates as text. If your date criteria mysteriously match nothing, check with ISTEXT() on the date column. The generator flags this when your description mentions dates.

OR logic: the thing SUMIFS can't do alone

SUMIFS criteria are always AND — every condition must hold. For OR ("Q1 or Q2", "Online or Retail"), you add multiple SUMIFS together: =SUMIFS(C:C,A:A,"Q1")+SUMIFS(C:C,A:A,"Q2"). For many OR values, SUMPRODUCT with an array constant is cleaner: =SUMPRODUCT((A2:A1000={"Q1","Q2"})*C2:C1000).

Describe OR conditions in plain words ("Q1 or Q2") and the generator writes the correct structure instead of the broken =SUMIFS(...,"Q1","Q2") people attempt first. This is one of the highest-value things the tool does — the OR workaround is genuinely non-obvious.

When to graduate to a pivot table

SUMIFS/COUNTIFS shine for fixed summary cells: "total Q1 online revenue" in a dashboard header. They strain when the question is exploratory — "break revenue down by quarter AND channel AND region" becomes a grid of a dozen hand-written formulas that break when someone inserts a row.

That's pivot-table territory: drag fields, get every combination, refresh in one click. A good rule: one or two SUMIFS on a dashboard, pivot table for analysis. The generator builds the formula you asked for, but it'll nudge you toward the pivot when your description sounds like a cross-tab report.

Frequently asked questions

What's the difference between SUMIF and SUMIFS?▼

SUMIF handles one condition with the sum range last: =SUMIF(A:A,"Q1",C:C). SUMIFS handles many conditions with the sum range first: =SUMIFS(C:C,A:A,"Q1",B:B,"Online"). Use SUMIFS always — it does everything SUMIF does, and the plural habits transfer to COUNTIFS and AVERAGEIFS.

How do I do OR logic in SUMIFS?▼

SUMIFS is AND-only, so add separate SUMIFS calls: =SUMIFS(C:C,A:A,"Q1")+SUMIFS(C:C,A:A,"Q2"). For many OR values, =SUMPRODUCT((A2:A1000={"Q1","Q2"})*C2:C1000) is cleaner. Describe the OR in words and the generator writes it correctly.

Why is my SUMIFS returning 0?▼

Usual suspects: text-vs-number mismatch (criteria "10000" won't match the number 10000 in some locales), dates stored as text, trailing spaces in text criteria ("Online " ≠ "Online"), or criteria ranges of different sizes. Check ISTEXT()/ISNUMBER() on the column first.

Can COUNTIFS count between two dates?▼

Yes — use two criteria on the same range: =COUNTIFS(D2:D1000,">=2026-01-01",D2:D1000,"<2026-04-01"). Same-range-twice is the standard pattern for between logic, and it works for numbers too.

Related tools