The quick answer

Pick SUMIF, SUMIFS, COUNTIF or COUNTIFS, fill in the test column, criteria and sum column, and the builder emits the formula with wildcards and operators quoted correctly. A plain-English recap reads it back, the preview updates live, all 5 function variants work, and nothing you type uploads.

One function family, endless forum threads

The request arrives as a sentence: total revenue for the West region. Twenty minutes later it is a SUM with plus signs between twelve cell references, or a SUMIF returning 0 for reasons nobody in the thread can reproduce. The data is fine; the distance between the sentence and the syntax is the problem.

Conditional aggregation — sum, count, or average the rows that qualify — is the second thing everyone learns to want from a spreadsheet, right after basic arithmetic. It is also where the formula language stops being intuitive, because Excel's criteria argument is a mini-language wearing a string's clothing: ">1000" is not a number, "<>West" is not a comparison anyone writes naturally, and the moment you need two conditions at once, SUMIF turns into SUMIFS and swaps its argument order on you.

This builder collapses the distance. You pick the function — SUMIF, SUMIFS, COUNTIF, COUNTIFS, AVERAGEIF — fill in ranges and a criteria in plain fields, and get the formula with quoting, operators, and argument order handled correctly. Guardrails catch the classic mistakes as you type: trailing spaces, text where numbers belong, ranges of mismatched size. The output is a formula you can paste with the same confidence as typing it yourself would have cost you three attempts.

From a sentence to a formula

The builder asks the question the way you already phrase it: which column do I test, what am I testing for, which column do I aggregate. Add a second condition pair and the selector flips from SUMIF to SUMIFS with the argument order fixed. Pick COUNTIF and the sum-range field disappears.

The criteria field is where builders usually stop and where this one keeps going. Type a bare number and it's treated as equality. Type >3000 and the builder quotes the operator into the string properly. Type a cell reference in the value box and the concatenation form — ">"&G1 — is assembled for you, the pattern that everyone googles the first time they need a threshold that isn't hardcoded. Wildcards get a helper panel showing what * and ? will do to the specific text you entered, so "W*" stops being a guess about behavior.

Below the fields, the generated formula renders live with a plain-English recap underneath: "Sums column E where column A equals West." That recap line is not decoration. It catches reversed arguments — the moment the recap says "sums column A where column E equals West," you've found the bug that would otherwise surface as a mysteriously small total. Same engine, incidentally, that powers the group-by features in our SQL on CSV tool: criteria fields in, correct aggregation out.

Generating a conditional sum, field by field

  1. Choose the function

    SUMIF for one condition; SUMIFS for several; the COUNTIF family when the answer is a count, not a total. The selector lists all five supported functions with a one-line description of when each applies. Switching later preserves your filled fields where they still make sense.

  2. Enter the ranges

    Criteria range and sum range as A1-style references. The builder validates that both cover the same number of rows — mismatched sizes are the #VALUE! error waiting to happen, flagged here before it ever happens.

  3. Fill the criteria

    A value or a cell reference, plus an optional comparison operator. Equal, not-equal, greater-than, less-than, and the inclusive variants — quoted automatically in the generated formula.

  4. Add condition pairs if needed

    Each added pair switches the output to the plural form with correct argument order. Multiple pairs are AND logic, which the recap sentence states explicitly.

  5. Read the recap, copy the formula

    The plain-English line beneath the preview confirms what will be computed. Copy with one click — quoting, separators, and parentheses are already correct.

The criteria mini-language, documented

Excel's criteria argument is a mini-language inside a string: ">1000" is not a number, "<>West" is not a comparison anyone writes naturally, and the blank-matchers are inverted from every instinct. The table below is the full working vocabulary.

CriteriaMatchesNotes
WestCells equal to West (case-insensitive)A bare value is equality; case never matters
>3000Numbers greater than 3000Operator inside the quotes — the quoting is mandatory
<>WestAnything that isn't WestIncludes blanks? No — see the blank rows below
<>Non-blank cellsThe bare not-equal is the standard 'has content' test
=Blank cellsEqual-to-nothing — the counterintuitive blank matcher
W*Text starting with W* = any run of characters, including none
G?zzleSix characters: G, any one, z, z, l, e? = exactly one character
~*A literal asteriskTilde escapes the wildcards: ~* and ~? and ~~
>"&G1Greater than the value in G1Concatenation form — operator quoted, reference attached with &
The criteria string grammar for the SUMIF/COUNTIF family.

Three of these deserve their own warning labels. First, wildcards are active by default in text criteria, so a criteria of "*" on a column of part numbers will happily match everything textual — and if your part numbers contain real asterisks, you need the tilde escape or the count will be wrong forever. Second, comparison operators like > work only against numbers and dates; text cells are simply skipped by numeric comparisons rather than erroring, which converts a data problem into a quietly too-small total. Third, the blank-matchers are inverted from every instinct: "<>" means has content, "=" means blank. People guess the opposite and spend an afternoon wondering why the counts won't reconcile.

-- Cell-reference thresholds: operator quoted, reference concatenated
=SUMIF(E2:E7, ">"&G1)          ' sum revenues above the value in G1

-- Date windows: two pairs, one date column
=SUMIFS(E2:E7, A2:A7, ">="&DATE(2026,1,1), A2:A7, "<"&DATE(2027,1,1))

-- Not-equal exclusion
=SUMIF(B2:B7, "<>West", E2:E7)   ' everything except the West rows

SUMIF versus SUMIFS: the argument-order trap

The singular and plural forms were born a decade apart and their signatures show the seam. SUMIF puts the sum range last and optional; SUMIFS leads with it and takes up to 127 pairs. The builder fills ranges by role and places each in the correct slot for whichever function the condition count requires.

The order reversal is not a design decision anyone would defend. It survives because changing either signature now would break a billion existing workbooks, so instead every Excel course since 2007 has taught "note the order flip" as a rite of passage, and every year a new cohort pastes SUMIF argument layouts into SUMIFS and computes the sum of a region column. The builder makes the issue invisible: you fill in ranges by role — what to test, what to aggregate — and the compiler places them in the correct slot for whichever function the condition count requires. Switching from one condition to two rewrites the formula's structure automatically. The recap sentence is the audit trail.

A sales ledger, aggregated five ways

Here is a six-row ledger — region, rep, product, units, revenue — the shape of every sales export since spreadsheets began. Every formula below was generated by the builder from this data, and every total is checkable with mental arithmetic: the West rows sum to 14,005.00 across three matching rows.

     A      B         C        D     E
1  Region  Rep       Product  Units Revenue
2  West    A. Chen   Widget   120   4980.00
3  East    J. Marsh  Widget    90   3735.00
4  West    A. Chen   Gadget    40   3400.00
5  East    P. Okafor Widget    60   2490.00
6  West    R. Silva  Gizmo     75   5625.00
7  South   P. Okafor Gadget    25   2125.00
Worked example — one condition: the West total

Input

=SUMIF(A2:A7, "West", E2:E7)

Output

14,005.00

West rows: 4,980.00 (Widget) + 3,400.00 (Gadget) + 5,625.00 (Gizmo). Three rows match the criteria; the other three are never added. Recap: "Sums column E where column A equals West."
Worked example — two conditions: West, and Widget only

Input

=SUMIFS(E2:E7, A2:A7, "West", C2:C7, "Widget")

Output

4,980.00

Only row 2 satisfies both pairs — region West AND product Widget. Row 4 is West but Gadget; row 3 is Widget but East. AND logic across pairs, enforced by the function itself.

Generated argument order: sum range first, then the pairs — the layout SUMIF users get wrong by reflex.
Worked example — counts and a numeric threshold

Input

=COUNTIF(C2:C7, "Widget")
=SUMIF(E2:E7, ">3000")
=COUNTIFS(A2:A7, "West", D2:D7, ">=100")

Output

COUNTIF → 3 (rows 2, 3, 5 — text criteria, case-insensitive)

SUMIF >3000 → 17,740.00 (4,980 + 3,735 + 3,400 + 5,625; the 2,490 and 2,125 rows fall below the threshold and the comparison skips them)

COUNTIFS → 1 (West rows are 120, 40, 75 units; only the first clears >=100)
Worked example — wildcard and average

Input

=SUMIF(C2:C7, "W*", E2:E7)
=AVERAGEIF(A2:A7, "West", E2:E7)

Output

W* → 11,205.00 (all three Widget rows: 4,980 + 3,735 + 2,490 — Gizmo starts with G, Gadget with G, so only W-products match)

AVERAGEIF → 4,668.33 (the three West revenues averaged: 14,005 / 3)

AVERAGEIF with zero matches returns #DIV/0! rather than 0 — worth knowing before it appears uninvited in a report.

Wildcard criteria that quietly misbehave

  • Numbers stored as text are invisible to numeric criteria. A revenue column pasted from a report can look numeric and sum to zero, because SUMIF skips text-typed cells in the sum range. The builder warns when the sum-range field looks like a label row; the fix in the workbook is converting the column — multiply by 1 via paste-special, or use Data → Text to Columns.
  • Trailing spaces defeat equality. "West " with a space is not West, and the count comes out one row short. These spaces are invisible in the cell, visible in the formula bar, and the leading cause of criteria that "should work." The builder trims and flags them in the criteria field.
  • Wildcards strike unintentionally. If SKU values literally contain * or ?, a plain equality criteria interprets them as wildcards and matches too much. Escape with tilde: "~*" means an actual asterisk. Nobody has ever enjoyed learning this.
  • Whole-column references are safe but slow at scale. SUMIF over A:A works fine — the function uses used-range optimization — but a 40-conditional-pair dashboard over a million rows is a recalculation you can watch. Bounded ranges (A2:A5000) keep volatile workbooks honest.
  • Dates as text criteria misfire. "">3/31/2026"" compares a number against a text rendering — sometimes accidentally right, structurally wrong. Use the concatenation with DATE(): ">"&DATE(2026,3,31), which compares date serials to date serials.
  • COUNTIF criteria longer than 255 characters error out with #VALUE!. It sounds absurd until someone embeds a multi-clause OR string in one criteria. Split the logic into COUNTIFS pairs or use SUMPRODUCT.
  • Merged cells break the geometry. A criteria range containing merged cells reports the value only in the anchor cell and blanks elsewhere, so per-region totals undercount every merged region label. Unmerge before aggregating, or the numbers will look plausible and be wrong.
  • The 127-pair ceiling. SUMIFS accepts up to 127 range/criteria pairs, which sounds unlimited until a multi-select report UI generates criteria dynamically. If you're near triple digits, a PivotTable or a helper flag column is the maintainable answer.

SUMIFS versus PivotTable versus FILTER

Three roads to "total revenue for the West region." A PivotTable while the question is exploratory, SUMIFS once the numbers land in something with a deadline, FILTER where every consumer is on a modern Excel. The table below compares them honestly, including where each one costs you.

ApproachLive in the sheet?Handles growing dataBest atCosts
SUMIFS familyYes — a formula in a cellAdd pairs, adjust rangesFixed, reportable numbers with audit trailsHand-built; criteria mini-language to learn
PivotTableNeeds refreshDrag fields, slice interactivelyExploring dimensions you haven't decided yetNot a formula — output doesn't flow into other formulas cleanly
FILTER + SUM (Excel 365)Yes — dynamic arraySpills automaticallyModern workbooks, criteria computed by other cells365-only; a step removed for collaborators on older versions
Choosing the aggregation route for a given question.

The working rule we recommend: use a PivotTable while the question is still exploratory — while you're asking "what even is the shape of this data" — and graduate to SUMIFS the moment the numbers land in something with a deadline on it. A formula is a commitment: it recalculates, it documents its own logic, and it survives a colleague opening the file. The FILTER route is what a modern-shop version of that commitment looks like, with the caveat that anyone still on Excel 2019 sees a #NAME? where your elegant dynamic array used to be. For lookup-shaped variants of the same reporting problem, the VLOOKUP Formula Generator is the neighboring tool.

Your ranges and criteria never leave the tab

Nothing you type goes anywhere. Ranges, criteria, the generated formula and the recap all exist in the browser tab and nowhere else — no account, no history, no telemetry about which columns your company aggregates. The fields describe your business, and the correct number of parties with access to that description is one.

The builder also runs entirely offline once loaded, since it's plain client-side JavaScript. Build commission formulas from a plane, verify counts from a plant floor, close the tab when done. The formula you paste into your workbook is the only artifact, and it lives where you put it.

Frequently asked questions

What's the real difference between SUMIF and SUMIFS?

Two things: argument order and condition capacity. SUMIF(range, criteria, sum_range) takes one condition, with the sum range as the third argument. SUMIFS(sum_range, criteria_range1, criteria1, ...) takes up to 127 condition pairs, with the sum range first. The reversal is the single most common formula error in the family — people paste a SUMIF layout into SUMIFS and sum a criteria column instead of their numbers.

Why does my SUMIF return 0 when the data is clearly there?

The usual suspects, in order of frequency: numbers stored as text in the sum range (Excel silently skips them), a trailing space in the criteria ("West " versus "West"), and comparing a text-formatted number to a numeric criteria. The builder's guardrails flag each case as you fill the fields — trailing spaces get trimmed visibly, and numeric fields warn when they receive text.

How do wildcards work in SUMIF and COUNTIF criteria?

An asterisk matches any run of characters, a question mark matches exactly one, and a tilde escapes a literal star or question mark. "W*" matches Widget and Wrench; "G?zzle" does not match Gizmo (wrong third letter) but matches Gizzle. Note that wildcards apply to text comparisons only, and that criteria like "*" alone match any text cell while skipping pure numbers.

How do I sum values between two dates?

Use SUMIFS with two pairs against the same date column: =SUMIFS(D:D, A:A, ">="&DATE(2026,1,1), A:A, "<="&DATE(2026,3,31)). The comparison operators live inside quotes, the date boundary concatenates on with &, and both conditions hit the same range — which is legal and extremely common for date windows.

Does COUNTIF count case-sensitively?

No. COUNTIF, SUMIF, and the whole family match text without regard to case, like Excel's = operator. If "widget" and "Widget" must count separately, the workaround is SUMPRODUCT with EXACT: =SUMPRODUCT(--EXACT(A2:A100, "Widget")), which compares byte for byte.

Do these formulas work the same in Google Sheets?

Yes — SUMIF, SUMIFS, COUNTIF, COUNTIFS, AVERAGEIF, and AVERAGEIFS share names, argument order, and wildcard behavior between Excel and Google Sheets. Formulas generated here paste and calculate identically in both, including the criteria mini-language with quoted comparison operators.

Is this builder free, and is my data sent anywhere?

Free, and nothing leaves the page. The field values and the generated formula exist in the tab's memory only — no account, no upload, no save-for-later. The builder is JavaScript running locally, which also means it works offline once the page has loaded.

Sources and further reading

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.