ShareYourGroupShareYourGroupGoogle Sheets

Math and counting

SUMIF and SUMIFS functions in Google Sheets

SUMIF adds the cells that meet one condition; SUMIFS adds the cells that meet several.

These two answer "what is the total for this?": sales for a region, spending for a category, hours for a person. They are the quickest route from a list to a summary.

Syntax

=SUMIF(range, criterion, [sum_range])
=SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2], ...)
ArgumentWhat it is
rangeThe cells to test.
criterionThe condition: "North", ">1000", or a cell.
sum_rangeThe cells to add. Last in SUMIF, first in SUMIFS.

Examples

Sample sheet: Twelve sales made by four salespeople in three regions.
ABCDEF
1DateSalespersonRegionProductUnitsAmount
205-Jan-2026AshaNorthNotebook201200
312-Jan-2026RaviSouthPen50500
420-Jan-2026MeenaNorthBag43000
502-Feb-2026AshaEastPen30300
614-Feb-2026KabirSouthNotebook15900
728-Feb-2026RaviNorthBag21500
803-Mar-2026MeenaEastNotebook402400
915-Mar-2026AshaNorthBag32250
1022-Mar-2026KabirSouthPen60600
1101-Apr-2026RaviEastNotebook251500
1218-Apr-2026MeenaNorthPen80800
1306-May-2026AshaSouthBag53750

SUMIF

SUMIF tests each cell of the first range. For each one that passes, it adds the cell on the same row of the sum range.

SUMIFS

SUMIFS allows several conditions, and a row is added only when it passes all of them. Note the order: the range to add comes first, then the pairs. Many people use SUMIFS even for a single condition, to have one order to remember.

Writing conditions

ConditionMeaning
"North"equal to the text
1000equal to the number
">1000"greater than
"<>Pen"not equal to
H1equal to the value in H1
">="&H1at least the value in H1
"*book*"contains
"A*"starts with A

A comparison sign goes inside the quotation marks. A cell reference stays outside and is joined with &. Text matching ignores case.

For dates, build the date with DATE or point to a cell.

A total for every item, from one formula

Here Sheets differs from older Excel in a useful way. Inside ARRAYFORMULA, SUMIF accepts a list of criteria and returns a total for each, as the last example shows. With the regions listed in H2:H4:

=ARRAYFORMULA(SUMIF(C2:C, H2:H4, F2:F))

Pair it with =UNIQUE(C2:C) in H2 and you have a summary that needs no copying down.

SUMIFS does not expand in this way. For totals on two or more conditions down a column, the usual answers are QUERY with group by, or a SUMIF on a helper column that joins the two keys.

QUERY and FILTER as alternatives

A pivot table, under Insert, does the same without formulas.

Open-ended ranges

Sheets lets a range run to the bottom of the sheet: C2:C. Summaries then include new rows without anyone editing the formula. All the ranges in one formula must still be the same length, so use C2:C with F2:F, not with F2:F13.

Common mistakes

In Excel

SUMIF and SUMIFS have the same arguments in Excel.

Related functions

The results on this page were worked out by us from the sample sheet; they were not produced by a script running Google Sheets. If Sheets shows you something different, please tell us.

This is an independent help site. It is not connected with or approved by Google. Google Sheets is a trademark of Google LLC, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.