excel-38
excel-38
The AVERAGEIFS and SUMIFS functions start with a data range that contains values
that the formula summarizes. You then list the data ranges and the criteria to apply to
that range. In generic terms, the syntax is =AVERAGEIFS(data_range, criteria_range1,
criteria1[,criteria_range2, criteria2...]). The part of the syntax in brackets (which aren’t
used when you create the formula) is optional, so an AVERAGEIFS or SUMIFS formula
that contains a single criterion will work. The COUNTIFS function, which doesn’t per-
form any calculations, doesn’t need a data range; you just provide the criteria ranges
3
and criteria. For example, you could find the number of customers from Washington
who were billed at least $100,000 by using the formula =COUNTIFS(C2:C5, “=WA”,
D2:D5, “>=100000”).
You can use the IFERROR function to display a custom error message instead of
relying on the default Excel error messages to explain what happened. For example,
you could create this type of formula to employ the VLOOKUP function to look up
a customer’s name in the second column of a table named Customers based on the
customer identification number entered into cell G8. That formula might look like this:
=IFERROR(VLOOKUP(G8,Customers,2,FALSE),”Customer not found”). If the function
finds a match for the customer ID in cell G8, it displays the customer’s name; if not, it
displays the text “Customer not found.”
TIP The last two arguments in the VLOOKUP function tell the formula to look in the
Customers table’s second column and to require an exact match. For more information
about the VLOOKUP function, see “Look up data from other locations” in Chapter 7, “Combine
data from multiple sources.”
85