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

Click on cell F3, and then select the first criteria within the formula, as shown in Figure 2.
Figure 2: Select the first criteria within the formula
Figure 3: Press F9 to show the corresponding values for a portion of an Excel formula
Notice that ($A$2:$A$6=G$2) changes to {TRUE;TRUE;FALSE;TRUE;TRUE}. The TRUE values indicate cells where the word Operations appears, FALSE appears when something else is in the cell.
Next, select this portion of the formula and press F9
Your formula should now look like this:
You can see that both sets of criteria return TRUE for the first two values. The last 3 values return varying combinations of TRUE/FALSE. Excel uses the TRUE values to identify which cells to add up in the range C2:C6.
Finally, select the entire IF statement in the formula bar and press F9 to see this result:
The word FALSE and zero are interchangeable in Excel formulas, which is why SUM can add up all of the values and only return a value for the cells where both criteria are met. In essence, Excel creates an array that stores the values that it sums, rather than referring to a set range of cells. This allows array formulas to perform calculations that aren’t possible with typical worksheet formulas.
Keep in mind that the F9 trick I just shared is a helpful formula auditing tool, but be sure to press the Escape key to restore your formula. If you press Enter or Ctrl-Shift-Enter, you’ll replace your cell references with static values. If you forget to press Escape, press Ctrl-Z immediately to restore the original formula.
Also, there are other alternatives for summing ranges based on multiple criteria. Excel 2007 and 2010 users can use the new SUMIFS function, while the SUMPRODUCT function works in any version of Excel. Array formulas such as those above also work in any version of Excel, and provide yet another way to analyze data in Excel.
Now that we understand how the SUM function works with multiple criteria, we can apply the exact same technique with the MIN and MAX functions. Cell G3 in Figure 1 contains this formula:
Cell H3 in Figure 1 contains this formula:
Don’t forget to press Ctrl-Shift-Enter after you type these formulas.
About the author:
David H. Ringstrom, CPA heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at david@acctadv.com or follow him on Twitter. David speaks at conferences about Microsoft Excel, and presents webcasts for several CPE providers, including AccountingWEB partner CPE Link.

You may like these other stories...

Cybersecurity is no longer the domain of an organization's IT staff. It's moved to the boardroom, and in a big way. Accountants and financial managers may have been thinking it's just the province of the tech...
You probably don't want to think about how many times you access the File menu in Excel 2010 or 2013. Personally I think Excel 2010 has the best possible File menu arrangement, other than having Print Preview grafted...
Following other recent high-profile hacking events, investigators discovered yesterday that hackers broke into the draft work paper files of several famous CPA firms. Revealing images of the scantily clad documents have been...

Already a member? log in here.

Upcoming CPE Webinars

Sep 24
In this jam-packed presentation Excel expert David Ringstrom, CPA will give you a crash-course in creating spreadsheet-based dashboards. A dashboard condenses large amounts of data into a compact space, yet enables the end user to easily drill down into details when warranted.
Sep 30
This webcast will include discussions of important issues in SSARS No. 19 and the current status of proposed changes by the Accounting and Review Services Committee in these statements.
Oct 21
Kristen Rampe will share how to speak and write more effectively by understanding your own and your audience's communication style.
Oct 23
Amber Setter will show the value of leadership assessments as tools for individual and organizational leadership development initiatives.