Excel AVERAGEIF Function
The AVERAGEIF function calculates the average (arithmetic mean) of the numbers in a range that meet the given criteria.
The AVERAGEIF function returns a numeric value.
- Cells in range that contain TRUE or FALSE are ignored.
- Empty cells in range and average_range are ignored.
- When criteria is an empty cell, it will be treated as zero (0) value.
- Logical operators (>,<,<>,=) and wildcards (*,?) for partial matching can be included in the criteria argument.
- The #DIV/0! error will occur if:
- no cells in range meet the criteria
- the values to be averaged are all non-numeric
- Average_range does not have to be the same size as range. The actual cells to average start from the top left cell in Average_range and are the cells that correspond to cells in range.
- Only one condition can be applied for in the AVERAGEIF function. If multiple criteria are needed, use the AVERAGEIFS function.
In this case, we need to calculate the averages of numbers which meet the different criteria in the table below. To achieve this goal, please do as follows:
1. Copy the formula below into cell F5.
=AVERAGEIF (B5:B14, E5, C5:C14)
2. Convert range and average_range in the above formula to absolute.
- Select range B5:B14, press the F4 key to get $B$5:$B$14
- Select range C5:C14, press the F4 key to get $C$5:$C$14.
3. Press the Enter button to get the result in F5.
4. Then drag the fill handle down to the cells you want to apply this formula too. The results are as the following screenshot shows.
- The criteria argument of the above formula is supplied as a cell reference.
- We can directly input value in criteria. The three formulas in the cell F5, F6, and F7 are respectively changed to:
=AVERAGEIF (B5:B14, "Mango", C5:C14)
=AVERAGEIF (B5:B14, "A*", C5:C14)
=AVERAGEIF (B5:B14, "<>Lemon", C5:C14)
- Criteria "Mango" means to average the sales of Mango.
Criteria "A*" means to average the sales of items which start with “A”.
Criteria "<>Lemon" means to average the sales of items which are not Lemon.
Excel DEVSQ Function
The DEVSQ function calculates the sum of squares of the deviations from the sample mean.
Excel DSTDEV Function
The DSTDEV function returns the estimated value of the standard deviation of a population based on a sample.
Excel DSTDEVP Function
The Excel DSTDEVP function returns the standard deviation of a population by using the numbers from the entire database that match the given criteria you specify.