SUMIFS Formula: How to Add Up Totals That Meet Several Rules

SUMIFS adds up the values in one column, but only for the rows where every condition you set is true. Use it when a total depends on two or more things at once, such as region and status and month.

This guide covers the syntax, how to build the formula step by step, how to choose between SUMIFS and its alternatives, the mistakes that produce wrong totals without any warning, and a worked example you can copy.

SOP 1: What SUMIFS does and when to reach for it

SUMIFS takes a column of numbers, tests one or more other columns against conditions, and adds up only the numbers in rows where all the conditions pass. It is part of the wider set of Essential Spreadsheet Formulas and Functions, and it sits in the same family as SUMIF, COUNTIFS and AVERAGEIFS.

Reach for it when the question contains the word “where” more than once. “What did the North region invoice?” needs one condition. “What did the North region invoice in March, for paid orders only?” needs three.

SOP 1.1: The syntax, argument by argument

The formula looks like this:

=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

  • sum_range is the column of numbers you want to add. It goes first, which is the opposite of what many people expect and the most common reason for an error.
  • criteria_range1 is the first column to test.
  • criteria1 is the condition that column must meet.
  • criteria_range2 and criteria2 are optional. You can add further pairs. Excel allows up to 127 range and criteria pairs, which is more than most workbooks will ever need.

Every criteria range must be the same size and shape as the sum range. If the sum range covers rows 2 to 500, each criteria range must cover rows 2 to 500 as well.

SOP 1.2: How criteria are matched

A criterion can be a plain value, a comparison or a cell reference.

  • Plain value: "North" matches cells that contain North. Matching is not case-sensitive, so “north” also matches.
  • Comparison: ">=1000", "<>Returned" or "<500" apply a test. The operator and the value sit inside the same set of quotation marks.
  • Cell reference: H2 matches whatever is in H2. If the test includes an operator, join it to the reference with an ampersand, for example ">="&H2.

Wildcards also work. An asterisk matches any run of characters, so "North*" matches “North Coast” and “North West”. A question mark matches exactly one character. To search for a real asterisk or question mark, put a tilde in front of it.

SUMIFS returns 0 when nothing matches. It does not return an error, which means a wrong criterion produces a quiet zero rather than a visible failure. That behaviour is the main reason to check results against a known figure.

Lapis Ledger Annual Budget

Skip the setup

Lapis Ledger Annual Budget

Monthly and annual budget tabs for Excel and Google Sheets, with category totals that add themselves up.

See it on Taskdale →

SOP 2: Build the formula step by step

Work through these steps in order. Most broken SUMIFS formulas can be traced back to skipping one of them.

  1. Confirm the data is a block of rows with one record per row and a header row on top.
  2. Identify the number you want to total and the columns that hold each condition.
  3. Put each criterion in its own labelled cell, away from the data.
  4. Write the formula with cell references, not typed values.
  5. Test the result against a figure you can verify by hand, such as a single filtered view or a small subset.
  6. Copy the formula into the summary cells and check that the references did not shift.

SOP 2.1: Lay out the data

Keep one header per column and no blank rows or blank columns inside the block. A blank row in the middle of the data does not break SUMIFS, but it breaks sorting, filtering and table features that many people use alongside it.

If the data is in an Excel Table (Insert, then Table), the formula can refer to column names such as Table1[Revenue]. The references then expand automatically when rows are added, which removes one of the most common causes of wrong totals, namely a formula that stops at row 500 when the data now runs to row 620.

SOP 2.2: Put the criteria in their own cells

Hard-coding “North” and “Paid” inside the formula works for a single report. It becomes a problem the first time someone wants the same formula for South.

Place the criteria in labelled cells on a control area, for example:

  • H2: Region, with the value North in I2
  • H3: Status, with the value Paid in I3
  • H4: From, with the date 01/03/2024 in I4
  • H5: To, with the date 31/03/2024 in I5

Then the formula reads from the cells, and changing a single input updates every total that depends on it.

SOP 2.3: Write and check the formula

With the layout above, the formula for paid North revenue in March 2024 is:

=SUMIFS(E2:E500, B2:B500, I2, D2:D500, I3, A2:A500, ">="&I4, A2:A500, "<="&I5)

Here E is the revenue, B the region, D the status and A the date. Check the result by filtering the sheet to the same conditions and reading the subtotal in the status bar. If the two figures differ, the cause is almost always in the criteria, not in the arithmetic.

SOP 4: Handle OR logic, dates and partial text

Three situations cause the most questions after the basic formula is working.

SOP 4.1: Conditions joined by OR

SUMIFS applies its conditions with AND. Each additional pair narrows the rows further. For an OR condition on a single column, such as North or South, the usual approach is to put the options in an array constant and wrap the formula in SUM:

=SUM(SUMIFS(E2:E500, B2:B500, {"North","South"}, D2:D500, "Paid"))

SUMIFS returns one total for each item in the array, and SUM adds them together. This works in Excel and in most cases in Google Sheets. If the list of options comes from cells, list them in a range and use it in place of the constant, or switch to SUMPRODUCT.

For OR conditions across different columns, such as paid or part-paid, SUMIFS with two separate formulas added together is clearer than trying to force the logic into one expression. Two formulas also avoid double counting when the rules overlap, so check that the rows cannot meet both conditions at once.

SOP 4.2: Dates

Excel and Sheets store dates as serial numbers. A criterion typed as text such as "March 2024" will not match a date, and neither will a criterion that refers to a cell formatted as text.

To select a date range, use two criteria on the same date column with a cell reference and an operator:

A2:A500, ">="&I4, A2:A500, "<="&I5

Make sure I4 and I5 hold real dates, not text that looks like dates. A quick test is to right-align the cell. Text usually sits on the left by default, and a real date usually sits on the right.

Dates that include a time can also cause trouble. A cell holding 31/03/2024 14:30 is not equal to 31/03/2024 when tested with an equals sign, but it is less than 01/04/2024, so the “to” criterion needs to be the next day with a “less than” operator if the data includes times.

SOP 4.3: Partial text and wildcards

Use a wildcard when the value you need varies in its ending or middle. A criterion of "Ref-2024*" picks up every reference beginning with that prefix. A criterion of "*Ltd*" picks up any company name containing “Ltd”, which is useful but can catch unintended matches such as “Ltd” inside another word.

Test a wildcard against a sample before you trust the total, because a pattern that is too loose adds rows you did not mean to include.

BalanceBloom Bookkeeping Studio

Ready-made template

BalanceBloom Bookkeeping Studio

Income, expenses, profit and loss and sales tax in one bookkeeping workbook for Excel and Google Sheets.

See it on Taskdale →

SOP 5: Common mistakes and how to diagnose them

Most of the wrong totals people report come from a short list of causes. Check these in order when a figure looks off.

  • Sum range and criteria ranges differ in size. The formula returns #VALUE!. Make every range start and end on the same rows.
  • Arguments in the wrong order. The sum range must come first. A formula copied from SUMIF and not corrected will produce a number, but a wrong one.
  • Criteria with trailing spaces. “North ” with a space at the end does not match “North”. Use TRIM on the source data, or clean the column once.
  • Numbers stored as text. SUMIFS skips text in the sum range, so a column of revenue figures pasted as text adds up to less than expected without any error. Convert the column to numbers with a paste-special step or a VALUE formula.
  • Dates stored as text. Criteria on text dates return zero. Convert the dates to real dates before building the formula.
  • Operator and cell reference not joined. Writing ">=I4" instead of ">="&I4 tests against the text “I4”, not against the value in I4. Nothing matches, and the total is zero.
  • Whole-column references in a volatile workbook. Not an error, but a source of slow recalculation. See SOP 6.1.
  • Expecting filters to change the result. SUMIFS adds up hidden rows. If the aim is to total only visible rows, use SUBTOTAL with function number 9 or 109, combined with a helper column that marks which rows pass the tests.
  • Mistaking blanks for zeros. The criterion "" matches empty cells and cells holding an empty string. The criterion "=" matches only truly empty cells. If the data mixes the two, pick the one that reflects the question.

A simple diagnostic is to replace the sum range with a COUNTIFS using the same criteria. If the count is zero, the problem is in the criteria. If the count is right but the total is wrong, the problem is in the values being summed.

SOP 7: Worked example: paid North revenue for March 2024

Take the following six rows from a sales ledger. Column A is the order date, B the region, C the customer, D the status and E the revenue in pounds.

RowA: DateB: RegionC: CustomerD: StatusE: Revenue (£)
204/03/2024NorthHale LtdPaid1,200
315/03/2024NorthOrchard & CoUnpaid850
420/03/2024SouthQuay SuppliesPaid640
528/03/2024NorthFerris LtdPaid2,100
602/02/2024NorthBrine ToolsPaid900
730/03/2024northCaddick LtdPaid300

The control cells are I2 for region (North), I3 for status (Paid), I4 for the start date (01/03/2024) and I5 for the end date (31/03/2024).

The formula is:

=SUMIFS(E2:E7, B2:B7, I2, D2:D7, I3, A2:A7, ">="&I4, A2:A7, "<="&I5)

Working through the rows by hand confirms the result:

  • Row 2 matches: North, Paid, 4 March. Included at £1,200.
  • Row 3 fails: status is Unpaid. Excluded.
  • Row 4 fails: region is South. Excluded.
  • Row 5 matches: North, Paid, 28 March. Included at £2,100.
  • Row 6 fails: the date is 2 February. Excluded.
  • Row 7 matches: “north” in lower case matches “North” because the comparison ignores case. Included at £300.

The total is £3,600. A filtered view on the same three conditions should show the same figure, which is the check described in SOP 2.3.

If the aim were to include South as well, the region criterion would become an array constant wrapped in SUM, as set out in SOP 4.1. Row 4 (£640) would then be added, giving £4,240.

Two points from the example are worth noting. The case-insensitive match on row 7 is helpful here, but it would also merge “north” and “North” in a report that someone meant to keep separate. And the total depends on the date criteria being real dates. If I4 or I5 held text, the formula would return a lower figure without any warning, which is why the test against a known result matters more than the formula itself.

Decision rule: when to use SUMIFS

Use SUMIFS when all of the following are true:

  1. The total needs one or more AND conditions on separate columns.
  2. The conditions are equality, comparison, date ranges or wildcard text.
  3. The result must update live when the source data changes.
  4. The workbook must work in Excel 2007 onwards or in Google Sheets.

If any of these is false, move to SUMPRODUCT for cross-column tests, FILTER for readable logic in current versions, or a PivotTable for one-off exploration. Before you rely on any total, check it against one figure you can verify by hand, because SUMIFS will return a zero or a partial sum without telling you that anything went wrong.

Margin Atlas Etsy Bookkeeping

Get the finished file

Margin Atlas Etsy Bookkeeping

Etsy fees, inventory and profit per listing, worked out with SUMIFS and lookups so you don’t have to.

See it on Taskdale →

Scroll to Top