The SUMIFS function in Excel allows you to sum values in a range based on one or more specific criteria. Unlike the basic SUMIF function, which only supports a single condition, SUMIFS can handle up to 127 different pairs of criteria ranges and criteria, making it an essential tool for analyzing complex datasets, such as calculating total sales for a specific product in a specific region during a specific month.
What You'll Need
- A computer with Microsoft Excel installed (all modern versions support SUMIFS).
- A dataset organized in a tabular format (columns for categories and a column for numeric values to sum).
- A basic understanding of how to select cell ranges in a spreadsheet.
Step-by-Step
To understand how to build a SUMIFS formula, let's use a practical example. Imagine you have a sales table with three columns: Column A (Salesperson), Column B (Region), and Column C (Sales Amount). You want to find the total sales for a salesperson named "Jane" in the "North" region.
- Identify your Sum Range: The first argument in a SUMIFS formula is always the range containing the numbers you want to add up. In our example, this is Column C (Sales Amount). If your data goes from row 2 to 100, your sum range is
C2:C100. - Define your first Criteria Range: This is the range of cells that Excel will check against your first condition. Since we are looking for a specific salesperson, the first criteria range is Column A (Salesperson), or
A2:A100. - Set your first Criteria: This is the specific value you are looking for within the first criteria range. In this case, it is "Jane". In the formula, text must be enclosed in double quotation marks:
"Jane". - Define your second Criteria Range: Now, add the range for the second condition. We want to filter by region, so the second criteria range is Column B (Region), or
B2:B100. - Set your second Criteria: The value for the second condition is "North". Again, use quotation marks:
"North". - Assemble the Formula: Combine these elements into the SUMIFS syntax:
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). Your final formula will look like this:=SUMIFS(C2:C100, A2:A100, "Jane", B2:B100, "North"). - Press Enter: Once you hit Enter, Excel will scan the ranges, find every row where Column A is "Jane" AND Column B is "North", and then add the corresponding values from Column C.
Common Mistakes
One of the most frequent errors when using SUMIFS is the mismatched range size. For the formula to work, the sum range and every single criteria range must be exactly the same size and shape. If your sum range is C2:C100 (99 cells) but your criteria range is A2:A101 (100 cells), Excel will return a #VALUE! error. Always double-check that your start and end row numbers are identical across all arguments.
Another common mistake is the incorrect use of quotation marks. Users often forget that any text or logical operator (like >, <, or <>) must be wrapped in quotes. For example, if you want to sum values greater than 500, you cannot write >500; you must write ">500". However, if you are referencing a cell that contains the value 500, you do not put the cell reference in quotes.
Users also frequently confuse SUMIF and SUMIFS. In the standard SUMIF (singular), the sum range is the last argument. In SUMIFS (plural), the sum range is the first argument. Switching these will result in either a 0 value or an error because Excel will try to sum the criteria column instead of the numeric column.
Tips
To make your spreadsheets more dynamic, use cell references instead of hard-coded text. Instead of typing "Jane" directly into the formula, type Jane's name in cell E1 and use the formula =SUMIFS(C2:C100, A2:A100, E1, B2:B100, F1). This allows you to change the salesperson or region in cells E1 and F1 to update the totals instantly without editing the formula itself.
If you need to sum values based on a date range, you can use logical operators. To sum sales between January 1st and January 31st, you would use two criteria for the same date column: =SUMIFS(C2:C100, D2:D100, ">=1/1/2023", D2:D100, "<=1/31/2023"). This effectively creates a "between" filter.
For those dealing with partial matches, use the asterisk (*) wildcard. If you want to sum everything for any salesperson whose name starts with "J", use "J*" as your criteria. The asterisk represents any number of characters. If you want to find any entry containing the word "North" (like "North East" and "North West"), use "*North*".
Troubleshooting
If your SUMIFS formula is returning 0 when you know there should be a result, check for trailing spaces in your data. A cell that contains "Jane " (with a space at the end) will not match the criteria "Jane". You can fix this by using the TRIM function on your data or by using wildcards in your formula (e.g., "*Jane*") to see if the result changes.
If you see a #VALUE! error, immediately check your range dimensions. Ensure that if your first range is A1:A50, every subsequent range is also 50 cells long. If you are referencing entire columns (e.g., C:C, A:A, B:B), this error is less likely, but it is a common issue when selecting specific blocks of cells.
If the formula is returning an incorrect total, verify that your sum range actually contains numbers. Sometimes numbers are formatted as text, which Excel cannot sum. You can tell if a number is stored as text if it is left-aligned in the cell or if there is a small green triangle in the top-left corner of the cell. To fix this, select the cells, click the warning icon, and select "Convert to Number".
Finally, if the formula isn't calculating automatically, check your Calculation Options. Go to the Formulas tab > Calculation Options and ensure "Automatic" is selected. If it is set to "Manual", you will need to press F9 to refresh the results.
Frequently Asked Questions
Can I use SUMIFS with OR logic?
By default, SUMIFS uses AND logic (all conditions must be true). To achieve OR logic (e.g., sum if the region is "North" OR "South"), you can add two SUMIFS formulas together: =SUMIFS(...) + SUMIFS(...).
Is there a limit to how many criteria I can use?
Yes, the SUMIFS function supports up to 127 pairs of criteria ranges and criteria. In practice, most users rarely exceed five or six, but the capacity is quite high.
Can SUMIFS work across different worksheets?
Yes. When selecting your ranges, you can click over to another sheet. The formula will simply include the sheet name, such as =SUMIFS('SalesData'!C2:C100, 'SalesData'!A2:A100, "Jane").
Can I use a cell reference with a logical operator?
Yes, but you must use the ampersand (&) to join them. For example, to sum values greater than a number in cell E1, use ">="&E1 instead of ">=E1".
Does SUMIFS work with empty cells?
Yes. If you want to sum values where a criteria cell is blank, use "" as your criteria. To sum where a cell is NOT blank, use "<>".
Is SUMIFS slower than a Pivot Table?
For very large datasets (tens of thousands of rows), many SUMIFS formulas can slow down your workbook. In those cases, a Pivot Table is generally more efficient for summarizing data.