🟩 Sheet Formulas

Google Sheets COUNTIF / SUMIF Formula Builder

Pick a function, your ranges and a condition — this builder writes the exact COUNTIF, COUNTIFS, SUMIF or SUMIFS formula for you, with the fiddly quotes and operators (">", "<>", "*text*") already handled. Copy it straight into Google Sheets.

=COUNTIF(A:A, "apple")

How this COUNTIF / SUMIF builder works

COUNTIF counts cells that match one condition; SUMIF adds up a matching range. The two IFS versions let you stack a second condition. The part people get wrong is the criteria: Google Sheets wants comparison operators as text joined with &, e.g. ">"&100 for "greater than 100", or "*"&"red"&"*" for "contains red". This builder assembles that for you so a number, a cell reference like B1, or plain text each get quoted correctly.

Note the argument order flips between the families: SUMIF(range, criteria, sum_range) but SUMIFS(sum_range, range, criteria, …) — a classic source of #VALUE! and wrong totals. The builder outputs the right order every time.

Common ready-to-paste examples

Count how many cells in column A equal "apple":

=COUNTIF(A:A, "apple")

Count values in B greater than 100:

=COUNTIF(B:B, ">"&100)

Count rows where A is "red" AND C is over 50:

=COUNTIFS(A:A, "red", C:C, ">"&50)

Sum sales in B where region in A is "West":

=SUMIF(A:A, "West", B:B)

Sum B where A is "West" AND C is "2026":

=SUMIFS(B:B, A:A, "West", C:C, "2026")

FAQ

Do I need to put quotes around numbers in COUNTIF?

For a plain equals match like =COUNTIF(A:A, 100) you can skip quotes. But the moment you use an operator — greater than, less than, not equal — the whole thing becomes text, so it must be ">"&100. The builder adds this for you.

Why does my SUMIFS give #VALUE! or the wrong total?

Almost always the argument order. SUMIF puts the sum range last, SUMIFS puts it first. Also every criteria range in a SUMIFS must be the same height as the sum range, or you get a mismatch error.

How do I count cells that contain a word, not exactly match it?

Use wildcards: =COUNTIF(A:A, "*report*") counts any cell containing 'report'. Pick the 'contains text' condition in the builder and it wraps your value in asterisks.

Can I reference a cell instead of typing a value?

Yes. Type a cell like B1 in the value box; for operator conditions the builder writes ">"&B1 so the comparison reads the live cell value.