Excel Tip: Multiple criteria SUM, MIN, and MAX formulas

By David H. Ringstrom, CPA
 
Most Excel users are familiar with the SUM, MIN, and MAX functions in Excel. Used in their traditional fashion, you provide a range of cells to the function to derive a result:
 
  • =SUM(C2:C6) would add up all values in cells C2 through C6
  • =MIN(C2:C6) would return the smallest value within cells C2 through C6
  • =MAX(C2:C6) would return the largest value within cells C2 through C6
 
As shown in Figure 1, these formulas return 225,000, 29,000, and 70,000, respectively.
 
Figure 1: Sample payroll information that we wish to analyze
 
However, in certain cases you may wish to use this functions based on multiple criteria. It’s a simple process to do so, but one that requires a special keystroke after you type the formula. Typically you simply press Enter once you type a formula in a cell. However, in the case of the multiple criteria formulas I’m about to share, you’ll press Ctrl-Shift-Enter after you type the formula. Excel will accept the formula if you slip and just press the Enter key, but the formula may not return the desired result. In such cases, simply press F2 to edit the formula, and then press Ctrl-Shift-Enter.
 
Now, let’s say that we want to get the sum of just the jobs in the Operations department with a job code of 100. To do so, put the word Operations in cell F2, and the number 100 in cell E3. Next, enter the following formula in cell F3, and then press Ctrl-Shift-Enter:
 
=SUM(IF(($A$2:$A$6=F$2)*($B$2:$B$6=$E3),$C$2:$C$6))
 
You’ll notice that there’s an IF statement within the SUM. This allows us to specify multiple criteria, which we separate with an asterisk. Thus, ($A$2:$A$6=$F$2) identifies the cells in column A that contain the word Operations. The second criteria ($B$2:$B$6=$E3) identifies the cells in column B that contain the value 100. When both of these criteria are met, Excel creates an array of the corresponding values from cells $C$2:$C$6. Since the IF statement is contained within a SUM function, Excel adds up the values that meet both criteria. Although I only specified two criteria here, you can feel free to enter more criteria as needed.
 
You’ll notice that when you press Ctrl-Shift-Enter the formula bar displays curly brackets around the formula:
 
={SUM(IF(($A$2:$A$6=F$2)*($B$2:$B$6=$E3),$C$2:$C$6))}
 
The curly brackets indicate an array formula – these are special types of formulas in Excel that can carry out sophisticated techniques such as summing a range based on multiple criteria. Don’t type the curly brackets yourself – Excel adds them automatically when you press Ctrl-Shift-Enter.
 
To better understand how array formulas work, let’s step through the components. 

You may like these other stories...

In the old days, we used to tape down receipts from our travels and submit them to accounts payable. But that was before remote employees who may live in a different city from the home office. And of course, there's all...
In 2011, electrical services and technology provider Parsons Electric in Minneapolis, Minn., decided to take its accounting to the cloud. Monica Ross, the company's director of strategic projects, talked with AWEB about...
Event Date: July 24, 2014, 2 pm ET In this presentation Excel expert David Ringstrom, CPA revisits the Excel feature you should be using, but probably aren't. The Table feature offers the ability to both boost the...

Upcoming CPE Webinars

Jul 16
Hand off work to others with finesse and success. Kristen Rampe, CPA will share how to ensure delegated work is properly handled from start to finish in this content-rich one hour webinar.
Jul 17
This webcast will cover the preparation of the statement of cash flows and focus on accounting and disclosure policies for other important issues described below.
Jul 23
We can’t deny a great divide exists between the expectations and workplace needs of Baby Boomers and Millennials. To create thriving organizational performance, we need to shift the way in which we groom future leaders.
Jul 24
In this presentation Excel expert David Ringstrom, CPA revisits the Excel feature you should be using, but probably aren't. The Table feature offers the ability to both boost the integrity of your spreadsheets, but reduce maintenance as well.