Conditional Averages


In the real world, a simple average often isn't adequate for your needs. For example, an instructor might calculate student grades by averaging a series of test scores but omitting the two lowest scores. Or you might want to compute an average that ignores both the highest and lowest values. In cases such as these, the Average() function won't do, so you must create a more complex formula. The following Excel formula computes the average of the values contained in a range named "scores", but excludes the highest and lowest values:

=(SUM(scores)-MIN(scores)-MAX(scores))/(COUNT(scores)-2)

Here's an example that calculates an average excluding the two lowest scores:

=(SUM(scores)-MIN(scores)-SMALL(scores,2))/(COUNT(scores)-2)

(To use these formulas in 1-2-3, just add an @ before each function name and remove the = sign before them.)

- John Walkenbach


Category: spreadsheet
Issue: May 1999

These Web pages are produced by Australian PC World © 1999 IDG Communications