Skip to content
AnIntent

How to Use SUMIFS in Excel to Add Values That Meet Several Conditions

Write an Excel SUMIFS formula that adds numbers only when several conditions match, with wildcards and "not equal" criteria.

AnIntent Editorial · · 3 min read

Hands typing on a laptop displaying a data spreadsheet
Photo by Gorilla ROI Data Connector on Unsplash
In this article
  1. The SUMIFS syntax, argument by argument
  2. Build a SUMIFS formula step by step
  3. Two formulas from Microsoft's example
  4. When you need to match a real asterisk or question mark
  5. The mistake that breaks most SUMIFS formulas
Share this article

Excel's SUMIFS function adds up the numbers in one range, but only for rows where every condition you set is true. This guide covers the argument order, two working formulas from Microsoft, and how to handle the asterisk and question mark.

The SUMIFS syntax, argument by argument

Microsoft's SUMIFS reference page gives the syntax as:

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
  • sum_range holds the numbers you want added. It always comes first.
  • criteria_range1 is the column Excel checks for your first condition.
  • criteria1 is the condition itself.
  • [criteria_range2, criteria2], ... are optional extra pairs.

Think of everything after the first argument as range-and-condition pairs. A row is added only when it passes every pair.

Build a SUMIFS formula step by step

  1. Click the cell where you want the total.
  2. Type =SUMIFS( and select the range of numbers to add, then type a comma.
  3. Select the first range to check, type a comma, then type the condition in double quotes, such as "Tom".
  4. For each extra condition, type a comma, select its range, type a comma, and type its condition.
  5. Close the bracket and press Enter.

Two formulas from Microsoft's example

Microsoft's page uses a sheet with amounts in A2:A9, products in B2:B9 and salespeople in C2:C9. The first example is:

=SUMIFS(A2:A9,B2:B9,"=A*",C2:C9,"Tom")

This adds the amounts in A2:A9 where the product in column B begins with the letter A and the name in column C is Tom. The * stands in for any following characters.

The second example swaps the first condition for a "not equal" test:

=SUMIFS(A2:A9,B2:B9,"<>Bananas",C2:C9,"Tom")

Here <> means "not equal to", so the formula adds Tom's amounts for every product except Bananas. The operator goes inside the quotes with the value.

When you need to match a real asterisk or question mark

Because * and ? act as wildcards in criteria, a condition like "Q?" won't look for a literal question mark. Microsoft says to type a tilde (~) in front of the character to match it literally.

=SUMIFS(A2:A9,B2:B9,"Q~?")

The same goes for an asterisk: ~* matches a real *.

The mistake that breaks most SUMIFS formulas

The usual error is putting the range to check first and the numbers last. In SUMIFS, the range you're adding is always the first argument, and every argument after it comes in range-then-condition pairs. If your total looks wrong, read the formula left to right and confirm the first range holds numbers and each condition follows its own range.

For argument rules, error causes and version notes, check Microsoft's SUMIFS page directly. If you only need to count matching rows rather than add them, the logic is similar to COUNTIF in Google Sheets. To pull a single matching value instead of a total, use XLOOKUP.

Common questions

What order do the SUMIFS arguments go in?

Microsoft gives the syntax as SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). The range to add comes first, followed by range-and-condition pairs.

How do I write "not equal to" in SUMIFS?

Put <> inside the quotes before the value, as in Microsoft's example =SUMIFS(A2:A9,B2:B9,"<>Bananas",C2:C9,"Tom").

How do I match a literal asterisk or question mark?

Microsoft says to type a tilde (~) in front of the character, so ~* matches a real asterisk and ~? matches a real question mark.

A close up of a hard drive in a case
Buying guide

How to Choose an M.2 SSD for PS5: Check Heatsink Height Before Speed

Sony's PS5 SSD rules, explained: which specs matter, why heatsink thickness trips people up, and why you needn't pay for speed beyond 5,500 MB/s.

· 6 min

Keep reading