The SUMIFS function in Google Sheets sums numbers in a range only when they meet multiple criteria. Its syntax is =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]). For example, to sum sales in column C where column A equals “North” and column B equals “Q1”, you’d write =SUMIFS(C:C, A:A, "North", B:B, "Q1").
What Is SUMIFS and When to Use It
SUMIFS is the multi-condition version of SUMIF. While SUMIF handles one condition, SUMIFS handles two or more, all of which must be true for a value to be included in the total. It’s the go-to tool for filtering data by category, date range, text, or numeric thresholds before adding up the results.
Common uses include summing monthly expenses by department, totaling orders for a specific product and region, or adding up hours worked by employee and project. If you need to sum based on a single condition, SUMIF works fine, but SUMIFS is more flexible and often preferred because it can also handle one criterion.
How SUMIFS Works: Syntax and Arguments
The function takes a sum range (the cells to add) followed by pairs of criteria ranges and criteria. The order is important: sum range first, then each criteria range and its condition.
- sum_range – the range containing the numbers to sum.
- criteria_range1 – the range to check against the first criterion.
- criterion1 – the condition, such as “North”, “>100”, or a cell reference like F1.
- criteria_range2, criterion2 – additional pairs, up to 127 in Google Sheets.
All criteria ranges must have the same number of rows and columns as the sum range, otherwise you’ll get a #VALUE! error. For example, if sum_range is C2:C100, every criteria range must also be rows 2 through 100.
Real-World Example: Summing Sales by Region and Quarter
Suppose you have a spreadsheet with sales data: column A lists regions (North, South, East, West), column B lists quarters (Q1, Q2, Q3, Q4), and column C lists sales amounts. You want the total North sales in Q1.
With region names in A2:A100, quarters in B2:B100, and sales in C2:C100, the formula is:
=SUMIFS(C2:C100, A2:A100, "North", B2:B100, "Q1")
If the data has 100 rows and the North Q1 sales are 500, 300, and 200 in rows 2, 5, and 9, the formula returns 1000. The function checks each row: only rows where A equals “North” AND B equals “Q1” contribute their C value to the sum.
Using Cell References and Wildcards in Criteria
Instead of typing text directly, you can reference a cell containing the criterion. For example, if E1 holds “North” and E2 holds “Q1”, use =SUMIFS(C2:C100, A2:A100, E1, B2:B100, E2). This makes it easy to change criteria without editing the formula.
Wildcards work in text criteria: "*" matches any sequence of characters, and "?" matches any single character. To sum all regions that start with “N”, use =SUMIFS(C2:C100, A2:A100, "N*"). To match a literal asterisk or question mark, prefix it with a tilde (~), like "~*".
Common Mistakes and How to Fix Them
A frequent error is mismatched range sizes. If sum_range is C2:C100 and a criteria range is A2:A99, you’ll get a #VALUE! error. Always ensure all ranges have the same dimensions.
Another issue is using SUMIFS when you actually need OR logic. SUMIFS applies AND logic – all criteria must be true. To sum when any of several conditions are met, you can add multiple SUMIFS together, like =SUMIFS(C:C, A:A, "North") + SUMIFS(C:C, A:A, "South"). Alternatively, use SUMPRODUCT with arrays, but that’s more advanced.
Also, be careful with numeric criteria. For “greater than 100”, write ">100" as a text string. If you use a cell reference for the number, concatenate: ">"&G1 where G1 holds 100.
SUMIFS vs. SUMIF vs. QUERY
SUMIF is simpler for a single condition, but SUMIFS can do the same job and is more scalable. If you need to sum based on one criterion, either works; many users prefer SUMIFS for consistency.
QUERY is a more powerful alternative that uses SQL-like syntax. For example, =QUERY(A2:C100, "select sum(C) where A='North' and B='Q1' label sum(C) ''") returns the same result. QUERY is useful for complex aggregations, but it’s harder to learn and can be slower on large datasets. For most everyday multi-condition sums, SUMIFS is the right choice.
Performance and Large Data Sets
SUMIFS is efficient, but on very large sheets (tens of thousands of rows), using full-column references like C:C can slow down calculations because Google Sheets scans the entire column. To improve performance, limit ranges to the actual data area, e.g., C2:C10000 instead of C:C. Also, avoid using SUMIFS in array formulas unless necessary.
If you’re working with a huge dataset, consider using Pivot Tables, which are optimized for aggregation. You can create a pivot table to sum sales by region and quarter with just a few clicks, without writing formulas.
Frequently Asked Questions
Can SUMIFS sum based on dates? Yes. Use date criteria as text in the same format as the cells, e.g., "1/1/2023", or better, reference a date cell: =SUMIFS(C:C, B:B, ">="&E1) where E1 contains a date. For date ranges, add two criteria pairs: one for start date and one for end date.
Why is my SUMIFS returning 0? Check that the criteria match exactly. Text is case-insensitive, but extra spaces or non-printing characters can cause mismatches. Also verify the criteria range and sum range align; if you used full columns, ensure no header row is included in the sum range (e.g., use C2:C, not C:C, if row 1 is a header).
Can I use SUMIFS with multiple columns in the sum range? No, the sum range must be a single range. To sum across multiple columns, you can use SUMPRODUCT or add multiple SUMIFS. For example, to sum columns C and D where A is “North”, use =SUMIFS(C:C, A:A, "North") + SUMIFS(D:D, A:A, "North").
Does SUMIFS work with OR logic? No, it only does AND. To sum when any of several criteria are met, combine multiple SUMIFS with plus signs. For example, sum North OR South: =SUMIFS(C:C, A:A, "North") + SUMIFS(C:C, A:A, "South").
How do I use a cell reference for a text criterion? Simply reference the cell without quotes: =SUMIFS(C:C, A:A, E1). If E1 contains “North”, it will match exactly. For partial matches, use wildcards with the reference: "*"&E1&"*".
Is there a limit to the number of criteria? Google Sheets allows up to 127 criteria range/criterion pairs. In practice, you’ll rarely need more than a handful.
Related
- Traffic Signs Manual Chapter 5: All You Need
- Bosch PS41 Impact Driver: Specs, Power, and Real-World Use
- How to Lock Cells in Excel: Step-by-Step Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- JavaScript String Length: How the length Property WorksIn JavaScript, get a string’s length with its .length property—not a function call: const count = text.length;. The…
- How to Delete Grouping in Excel: Rows, Columns & SheetsTo delete a row or column grouping in Excel, select the grouped rows or columns, then choose Data…
- A0 Poster in PowerPoint: Set Up and Print at Full SizeTo make an A0 poster in PowerPoint, set the slide to 84.1 cm wide by 118.9 cm high…
- Balloon Payment Calculator with Set PaymentA balloon payment calculator with a set payment lets you input a fixed monthly payment amount and see…
- Count Excel Rows While Excluding Hidden Rows with SUBTOTALTo count visible Excel rows while excluding both filtered-out and manually hidden rows, use =SUBTOTAL(103,A2:A100) when every record…
- Most Used Excel Shortcut KeysThe most used Excel shortcut keys on Windows are Ctrl+C and Ctrl+V to copy and paste, Ctrl+Z to…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.