Overview: SUMIFS Google SheetsThe SUMIFS function in Google Sheets enables you to sum values in your spreadsheet based on predefined conditions. Show
Unlike the SUMIF function, which adds values to a sum based on a single condition, SUMIFS can enforce two or more conditions. The Google Sheets SUMIFS function only adds a value to a sum when all these conditions are met. This ultimate guide to SUMIFS in Google Sheets will show you how to master the function through a series of sample formulas, example use cases, and step-by-step walkthroughs. Why use the SUMIFS function in Google Sheets?In Google Sheets, the most basic way to get the sum of cell values is to create an additive formula. =B1+B2+B3+B4+B5 However, this rudimentary method isn’t practical when adding longer ranges of cells, such as entire rows or columns. That’s what SUM is for. But SUM isn’t feasible when you only want to sum certain values within a range. SUMIFS is a better option in such cases. Think of SUMIFS as a SUM function with superpowers. With SUMIFS, you can calculate sums across ranges easily, and define criteria to exclude certain values from the sum. Syntax of the Google Sheets SUMIFS functionThe basic syntax of the SUMIFS function looks like this: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], …) The syntax consists of the following arguments:
Each SUMIFs formula must define at least one range/criteria pair, although in that case, a SUMIF formula can accomplish the same operation. Key tips for using SUMIFS function in Google SheetsWhile implementing SUMIFS formulas in Google Sheets is relatively straightforward, consider these key tips to ensure a smooth process.
These tips will allow you to steer clear of the most common errors we’ve seen users make. Now onto the examples. How to use the SUMIFS function in Google SheetsBefore using SUMIFS formulas, let’s set up a sample dataset first. For this example, we’ll import sales data from HubSpot to Google Sheets using Coefficient. The Coefficient app lets you automatically sync data from your business systems with Sheets. Now let’s use this real-life data set to learn how to use the SUMIFS function. Let’s say you want the total amount for a specific item with a certain subscription status, such as Active Basic plans. In theory, you could use an arrayformula that looks like this: =ARRAYFORMULA(SUMPRODUCT((A6:A14=”Basic”)*(C6:C14=”Active”)*(B6:B14))) While using an ARRAY formula gives your expected result, it can be needlessly complex. An easier method is to use the Google Sheets SUMIFS function. Let’s define the arguments in the SUMIFS formula. We only want to add values associated with Active Basic plans:
The entire SUMIFS formula will look like this: =SUMIFS(B6:B14, A6:A14, “basic”, C6:C14,”active”) The final result corresponds to each argument in the formula: Now that we know the basics, let’s go over several other examples of using SUMIFS formulas with different criteria types. Using a SUMIFS function with logical operatorsYou should use comparison operators when SUMIFS criteria refer to dates or numbers. Here’s a refresher on how to deploy comparison operators in Google Sheets:
The SUMIFS formula below identifies subscriptions active before April 1st, 2022, and sums the values greater than or equal to 200. =SUMIFS(B6:B14,B6:B14,”>=200″, C6:C14, “<April 1, 2022”)
If you want to replace values with cell references, enclose the logical operator in quotation marks. Also, use an ampersand to concatenate the reference cell. Your formula will look like this: =SUMIFS(B6:B14,B6:B14,”>=”&B1, C6:C14, “<“&B2) Using SUMIFS with blank and non-blank cellsYou can also sum numbers in one column if a cell in a separate column is empty. Here’s how:
Let’s say the Activation Date column has empty cells. You can write a SUMIFS formula to sum Basic plans with set activation dates, based on the empty cells: =SUMIFS(B6:B14,A6:A14,”basic” ,C6:C14, “<>”) Using SUMIFS with other functionsThe conditions in a SUMIFs formula can use other functions as dependencies. In other words, you can embed other functions in the SUMIFS formula’s criteria. Let’s say we want to include activation dates from today. In this case, we can concatenate the less than or equal to operator (<+) with the TODAY () function inside the SUMIFS formula: =SUMIFS(B6:B14,A6:A14, B2,C6:C14, “<=”&TODAY()) Using SUMIFS with multiple OR criteria in the same columnYou can add two SUMIFS functions together as well. For instance, if you want to sum the values for “Basic” or “Enterprise” plans, you can use a SUMIFS() + SUMIFS() combination: =SUMIFS(B:B,A:A,”basic”) + SUMIFS(A:A,”business”,B:B) If there are three or more criteria, you should opt for a more compact formula. Include the items in an inline array. Use ArrayFormula to produce each item’s subtotal, and wrap everything in a SUM() function to add the subtotals. The formula will look like this: =SUM(ARRAYFORMULA(SUMIFS(A6:A14, {“basic”, “business”, “enterprise”}, B6:B14))) Now enter the items in individual cells. Include cell references for your array (for non-contiguous cells) or supply a range (for contiguous cells). We’ll narrow the list to these two items: =SUM(ARRAYFORMULA(SUMIFS(A6:A14, {B1, B2}, B6:B14))) Or =SUM(ARRAYFORMULA(SUMIFS(A6:A14, B1:B2, B6:B14))) If you want, you can add up subtotals using the SUMPRODUCT function instead of an ArrayFormula: =SUMPRODUCT((A6:A14=”basic”) + (A6:A14=”business”), B6:B14) Use this syntax for multiple OR criteria (with three or more items): =SUMPRODUCT((A6:A14={“basic”, “business”}) * B6:B14) Replace the array elements with cell references, and you’ll get a more compact formula. =SUMPRODUCT((A6:A14={B1, B2}) * B6:B14) Using SUMIF with OR criteria and results in other cellsAs shown above, you can generate each item’s subtotal in a different cell with an array formula. From there, you can adjust the cell references and remove the SUM() part, so the formula looks like this: =ARRAYFORMULA(SUMIFS(A4:A13, {“basic”, “business”, “enterprise”}, B4:B13)) In this example, the formula will produce the following results: Ensure you have empty cells to the right of the cell containing the formula. Google Sheets automatically places the results into cells corresponding to the number of items in your array constant. If you want to have your subtotals show in a column, make a vertical array by separating the elements with semicolons: =ARRAYFORMULA(SUMIFS(A3:A11, {“basic”; “business”; “enterprise”}, B3:B11)) Additionally, you can use a range reference to make your formula more flexible. This way, other users in your team can type items in the predefined cells, and you won’t need to update your formula. For instance, the formula shown above can take this form: =ARRAYFORMULA(SUMIFS(A3:A11, D3:D5, B3:B11)) Using SUMIFS with multiple OR criteria in different columnsYou can also leverage the SUMIFS function to sum numbers with multiple sets of conditions based on the following logic:
Here’s an example. Let’s sum the amount in column B if column A is either Basic or Enterprise and the activation date in column C is March 16, 2022. The obvious method is to take two SUMIFS formulas to add Basic and Enterprise separately, then add the results: =SUMIFS(B6:B14, A6:A14, “basic”, C6:C14, “Mar 16, 2022”) + SUMIFS(B6:B14, A6:A14, “enterprise”, C6:C14, “Mar 16, 2022”) But Google Sheets does not allow array constants with multiple OR conditions. Instead, you can use a slightly shorter formula featuring the SUMPRODUCT function. Use the formula below to sum numbers within B6:B14 based on the criteria above. =(SUMPRODUCT(–(C6:C14=B3), (–(ISNUMBER(MATCH(A6:A14, B2:C2, 0)))), B6:B14)) Here’s how the different parts of the formula work.
Only the values that correspond to the specified Subscription Plan and Activation Date will get summed. SUMIFS function: A versatile method for summing values based on conditionsA SUMIFS function makes it easier to sum values based on predefined conditions over a range of cells. If you can master SUMIFS and its variations, you can enhance your spreadsheet capabilities and make your formulae more efficient and elegant. Our customers typically use SUMIFS to perform more insightful analyses, while also optimizing spreadsheet performance. They implement the SUMIFS function with live data in Google Sheets via Coefficient. Try Coefficient for free right now! Can you use Sumif in Google Sheets?The SUMIF function in Google Sheets is used to sum across a range of cells based on a conditional test. The SUMIF function only adds values to the total when the condition is met.
What is better than Sumifs?Although using Sumifs formula look shorter than Index+Match formula, in fact Index+Match always faster than Sumifs (Lookup function always faster than Math function).
What are the advantages of Google Sheets over Excel?The major difference between Excel and Google Sheets is that you can share the link of Google Sheets with anyone and they can edit the file. This feature makes Google Sheets a perfect option for those who work in teams or shared projects.
Is Sumifs better than Vlookup?SUMIFS is a challenger quickly gaining popularity with Excel users. SUMIFS can do much of what VLOOKUP can do … but better :-) That is, SUMIFS makes a great alternative to VLOOKUP, and here's why: 1. SUMIFS matches equivalent values when stored as different data types.
|