Skip to content

SUMIFS Function in Excel: Syntax, Date Ranges, Wildcards and OR Logic

The SUMIFS function in Excel adds the numbers that meet every condition you set, and its sum range comes first. Here is the syntax, a worked example you can check by hand, how to sum between two dates, and why OR logic needs two SUMIFS added together.

Tech Talk News Editorial

9 min read

Share

Key takeaways

  • The syntax is SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...), you can use up to 127 range and criteria pairs, and every condition must be true for a row to be added.
  • SUMIFS puts sum_range first and SUMIF puts it third, and Microsoft names mixing up that order as a common source of errors; every criteria range must also have the same number of rows and columns as the sum range.
  • To sum between two dates, give the same date column two criteria, such as A2:A8,">="&DATE(2026,2,1) and A2:A8,"<="&DATE(2026,3,31); in the worked example this returns 410 for East.
  • SUMIFS has no OR; two conditions on the same column return 0 because no cell holds both values, so add two SUMIFS instead, which returns 700 for East plus West in the worked example.
  • A SUMIFS that returns 0 when you expected a total usually has text criteria without quotation marks, as Microsoft notes, or dates stored as text; a criteria range that is a different size from the sum range breaks the formula outright.
On this page10 sections

The SUMIFS function in Excel adds up the numbers in one column, but only for rows that meet every condition you set. The syntax is SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...), and you can use up to 127 range and criteria pairs.[1] The range you want to add comes first.

That one detail causes most of the damage, so let's start there. I checked the syntax and examples against Microsoft Support's pages on November 29, 2026.

The syntax, one piece at a time

  • sum_range: the cells to add.[1]
  • criteria_range1: the cells tested against the first condition.
  • criteria1: the condition itself, such as 32, ">32", B4 or "apples".[1]
  • criteria_range2, criteria2: optional extra pairs, up to 127 in all.

Every criteria range must have the same number of rows and columns as the sum range.[1] A row is added only when it passes every pair. That is AND logic, and it's the whole mental model.

Build one in four steps

  1. Click the cell where the total should go and type =SUMIFS(.
  2. Select the column to add up, then type a comma.
  3. Select the first column to test, type a comma, then its condition. Put text in quotation marks.
  4. Repeat step 3 for every extra condition, close the bracket and press Enter.

Microsoft's sales example is =SUMIFS(D2:D11,A2:A11,"South",C2:C11,"Meat"): add column D where column A says South and column C says Meat. Its result is 14,719.[2]

Summary

Read SUMIFS aloud as: add this column, where this column equals this, and this column equals that. If you can't say it that way, a range is in the wrong slot.

SUMIF vs SUMIFS: the argument order flips

SUMIF takes SUMIF(range, criteria, [sum_range]), and the cells to add come last, as an optional third argument.[3] In SUMIFS, sum_range is the first argument. Microsoft's page says mixing these up is a common source of errors.[1]

I'd use SUMIFS even for a single condition. You get one habit instead of two, and when a second condition shows up, you add a pair instead of rewriting the formula.

A worked example you can check by hand

Here is a small sales table in A1:D8, with a header in row 1. Type it in and every answer below can be verified with a calculator.

RowA: DateB: RegionC: RepD: Amount
201/10/2026EastAna120
301/22/2026WestBen80
402/03/2026EastBen200
502/14/2026NorthAna50
603/05/2026EastAna150
703/18/2026WestAna90
803/30/2026EastBen60

The amounts add up to 750. Now the conditions.

Two text conditions

=SUMIFS(D2:D8,B2:B8,"East",C2:C8,"Ana") returns 270, which is 120 from row 2 plus 150 from row 6. Rows 4 and 8 are East but belong to Ben, so they fail the second test.

Everything except one value

=SUMIFS(D2:D8,B2:B8,"<>North") returns 700, the 750 total minus the 50 in North. Microsoft's own example uses the same idea with "<>Bananas", and a second one, =SUMIFS(A2:A9, B2:B9, "=A*", C2:C9, "Tom"), returns 20.[1]

Sum between two dates

A date range is just two conditions on the same column: on or after the start, on or before the end. Join each operator to a date with the ampersand:

=SUMIFS(D2:D8,B2:B8,"East",A2:A8,">="&DATE(2026,2,1),A2:A8,"<="&DATE(2026,3,31))

That returns 410: the East rows dated February 3 (200), March 5 (150) and March 30 (60). The January 10 row fails the start date.

Why the ampersand? An operator like ">=" is text, and the date is a number, so you glue them into one criteria string. Microsoft's COUNTIFS page shows the same pattern with "<" & A6.[4] The reference, DATE and TODAY all work in that slot.

Keep dates real. Microsoft's YEARFRAC page warns that text dates can cause problems, and that dates are stored as serial numbers.[5] If a date criteria silently matches nothing, check whether the dates are text. To build a label for the period, see the concatenate guide.

Wildcards: ?, * and ~

A question mark matches any single character. An asterisk matches any sequence of characters. To find an actual question mark or asterisk, put a tilde in front of it.[1]

  • =SUMIFS(D2:D8,C2:C8,"?en") returns 340, the three Ben rows (80, 200 and 60).
  • =SUMIFS(D2:D8,B2:B8,"*st") returns 700, because East and West both end in st.

Wildcards are quiet OR logic, and that is the trap: they also match things you didn't mean. "*st" would pick up a region named Midwest too. Use them when the pattern is the point, not as a shortcut.

OR logic: SUMIFS only does AND

Ask one column to equal two values and you get nothing back. =SUMIFS(D2:D8,B2:B8,"East",B2:B8,"West") returns 0, because no row is both East and West. Every pair must pass, so it can't be.

The version that always works is to add two SUMIFS:

=SUMIFS(D2:D8,B2:B8,"East")+SUMIFS(D2:D8,B2:B8,"West")

That's 530 for East plus 170 for West, which is 700. It's longer than the tricks you'll find online, but anyone who opens the file can read it. Microsoft's SUMIFS page doesn't document an OR form, so I'm not going to pretend one exists in the syntax.

Why SUMIFS returns 0 or the wrong number

SymptomLikely causeFix
Result is 0Text criteria without quotation marks, per MicrosoftWrite "East", not East
Result is 0 for a date testThe dates are stored as textConvert them to real dates
Error instead of a numberA criteria range is a different size from the sum rangeMake every range the same rows and columns
Total is too high or oddTRUE or FALSE sits in the sum range and counts as 1 or 0Sum a column of numbers only
Wrong numbers after filling downRanges shiftedLock them, as in $D$2:$D$8

Table sources: Microsoft Support ([1] ). The first row, the range-size rule and the TRUE and FALSE note come straight from its common-problems list and remarks. The text-dates row follows the YEARFRAC page's warning about text dates.[5] I added the last row from practice, not from a Microsoft page.

Microsoft says TRUE counts as 1 and FALSE counts as 0 when they sit in the sum range.[1] That matters if you use checkboxes, which are TRUE or FALSE values. Put them in a criteria range, as in =SUMIFS(C2:C20,B2:B20,TRUE), not in the sum range. The checkbox guide covers the setup.

When to use something else

If you need a count rather than a sum, COUNTIFS takes the same pairs. If you are slicing the same table five ways, a PivotTable will beat five SUMIFS formulas, and it won't care about argument order.

Takeaway

SUMIFS is AND logic with the sum range first. Quote your text, keep your dates real, and add two SUMIFS when you need OR.

Next time you open an inherited workbook, click the SUMIFS and check which range sits first. It's the quickest way to find out if someone mixed it up with SUMIF.

Primary sources

  1. 1.PrimaryMicrosoft Support, "SUMIFS function". Syntax, 127 range and criteria pairs, wildcards and the tilde, range-size rule, argument order versus SUMIF, the <>Bananas and =A* examples, and common problems.
  2. 2.PrimaryMicrosoft Support, "Sum values based on multiple conditions". The South and Meat example, which returns 14,719. The page has no date or OR example.
  3. 3.PrimaryMicrosoft Support, "SUMIF function". SUMIF(range, criteria, [sum_range]), where sum_range is the optional third argument.
  4. 4.PrimaryMicrosoft Support, "COUNTIFS function". Criteria built from an operator and a cell reference with the ampersand, such as "<" & A6.
  5. 5.PrimaryMicrosoft Support, "YEARFRAC function". Dates are stored as serial numbers, and text dates can cause problems in date functions.

Frequently asked questions

6 questions

What does the SUMIFS function do in Excel?

SUMIFS adds the values in a sum range that meet all the conditions you give it. The syntax is SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...), with up to 127 range and criteria pairs. Microsoft's example =SUMIFS(D2:D11,A2:A11,"South",C2:C11,"Meat") returns 14,719.

What is the difference between SUMIF and SUMIFS?

SUMIF handles one condition and SUMIFS handles many. The argument order also differs: sum_range is the first argument in SUMIFS and the third argument in SUMIF. Microsoft calls mixing up that order a common source of errors.

How do I use SUMIFS with a date range?

Use two criteria on the date column, joined to a date with the ampersand: =SUMIFS(D2:D8,A2:A8,">="&DATE(2026,2,1),A2:A8,"<="&DATE(2026,3,31)). That sums every amount dated from February 1, 2026 through March 31, 2026.

How do I do OR logic in SUMIFS?

Add two SUMIFS together, one for each value: =SUMIFS(D2:D8,B2:B8,"East")+SUMIFS(D2:D8,B2:B8,"West"). A single SUMIFS combines its conditions with AND, so asking one column to equal two different values returns 0.

Why is my SUMIFS returning 0?

The most common cause is text criteria without quotation marks, which Microsoft lists as a reason SUMIFS returns 0. Other causes are criteria that match nothing and dates stored as text. A criteria range with a different number of rows or columns than the sum range breaks the formula, because Microsoft requires them to match.

Can SUMIFS use wildcards?

Yes. A question mark matches any single character and an asterisk matches any sequence of characters. To find a literal question mark or asterisk, put a tilde in front of it. For example, "A*" matches every text value that starts with A.

Keep reading

Written by

Tech Talk News Editorial

Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.

About Tech Talk News