SUMIF

You already know how to calculate sums, but what if you only want to total select items from a list or want to generate a separate list of subtotals without inserting subtotals in the middle of a list?  What is you wanted to use some criteria to screen what gets added, such as sales over a certain value?

SUMIF is a great function that serves these purposes.

SumIf Exercise and Result

In our example, we have sales data by region and product.  Let's first total it by region.  Below the data, create a list of the different regions.  Then we will total the sales by region, using the following SUMIF formula as shown in the formula in the worksheet below.

Lets look at components inside the formula:

For those of you who have already learned about using named ranges, this will make the formulas even simpler.  First, create three named ranges:

Then the SUMIF formula using named ranges would be:

=SUMIF(region,A16,sales)

Notice the benefit of using named ranges.  The formula is simpler.  You also don't have to worry about putting in the dollar signs to get the right row references.  The formula is also more intuitive for your reader or for you to check.

As you can see, SUMIF can be pretty powerful.  However, as with a lot of Excel functions, let's not just stop there.  Let's go a bit further and show a more powerful use of SUMIF that many people may not realize.

Let's do some groupings of the sales results, by sales ranges.  First, enter the sales ranges below the sales data.  Then we will enter the SUMIF calculation, but this time with a different twist.  Now, the sales data will be part of the range, as well as sum_range.  We also will use a different form of criteria, with a formula rather than a link.

The new formula varies for each cell.  For the range from 200-400 it is:

=SUMIF(C$2:C$13,"<400",C$2:C$13)-C16

As often is the case with Excel, you can accomplish the same result multiple ways.  Pivot tables are another way to accomplish this.  SUMIF is a good way to do calculations like this when you want to use less memory, keep the file size smaller or keep a certain look the result.

In our example, we kept the result on the same sheet as the list.  You can however, put the SUMIF formulas and results on a different sheet, such as a summary sheet.  If you do that, it is another reason to use named ranges and make your formula building easier.

SUMIF is a great way to summarize information.  Use what you learned here to use it in a number of creative ways.

Return To Excel Tips Index