SUMIF()

Syntax. SUMIF(range,criteria,sum_range)

Definition. This function adds all values in a range that match the search criteria.

Arguments

  • range (required) The range in which you want to find the criteria.

  • criteria (required) The criteria in the form of a number, an expression, or text. The criteria determine which cells will be added. For example, the criteria argument can be expressed as 32, “>32”, “32”, or “apples”.

  • sum_range (optional) The actual cells to add.

Background. The SUMIF() function can be used to filter for certain values in a list and add those values. The values in an array are added only if they match the search criterion.

Excel provides additional functions that allow you to analyze data based on a condition. To count text or numbers in an array, use the COUNTIF() function. This function, as well as the AVERAGEIF() and AVERAGEIFS() functions, are explained in Chapter 12.

To return one value or two values based on a condition, such as a sales bonus, use the logical IF() function (see Chapter 9).

Example. Assume that you have to add the sales in a list for sales representative Meier (see Figure 16-32).

Calculating the sum by using a filter.

Figure 16-32. Calculating the sum by using a filter.

Enter the following formula in cell B9:

=SUMIF(A2:A6,A9,B2:B6)
  1. Specify the array you want to filter (A2:A6).

  2. Enter the search criterion (A9).

  3. Specify the array containing the values you want to add (B2:B6).

The result is the sum of the sales for the sales representative Meier: $710.

If the sum_range argument is omitted, Excel adds the cells that are specified in the range argument.

See Also

AVERAGEIF(), AVERAGEIFS(), COUNTIF(), SUM(), SUMIFS()

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.187.113