Conditional Sums Using a Single Criterion

Often, you need to calculate a conditional sum. With a conditional sum, values in a range that meet one or more conditions are included in the sum. This section presents examples of conditional summing by using a single criterion.

The SUMIF function is very useful for single-criterion sum formulas. The SUMIF function takes three arguments:

  • range: The range containing the values that determine whether to include a particular cell in the sum.

  • criteria: An expression that determines whether to include a particular cell in the sum.

  • sum_range: Optional. The range that contains the cells you want to sum. If you omit this argument, the function uses the range specified in the first argument.

The examples that follow demonstrate the use of the SUMIF function. These formulas are based on the worksheet shown in Figure 17-13, set up to track invoices. Column F contains a formula that subtracts the date in column E from the date in column D. A negative number in column F indicates a past-due payment. The worksheet uses named ranges that correspond to the labels in row 1.

Figure 17-13. A negative value in column F indicates a past-due payment.

Let a Wizard Create Your Formula

Excel ships with an add-in called Conditional Sum wizard. After you install this add-in, you can invoke the wizard by choosing Formulas Solutions Conditional ...

Get Office 2007 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.