Tip of the Month:  February 2007

Microsoft Excel: Compute an average that excludes zero values

While Excel's AVERAGE function ignores blank cells, it doesn't ignore cells that contain 0. This can result in inaccurate analysis of the data.

For example, let's say you want to calculate the average score for all students who took the final exam. Using the AVERAGE function, you might enter: =AVERAGE(B3:B23).

But if two students were absent and received a grade of 0, the result of the formula wouldn't give a true picture of the average grade. However, you can calculate the average and exclude the absentee students' grades.

  1. Enter the following formula: =AVERAGE(IF(B3:B23<>0,B3:B23))
  2. Press CTRL+SHIFT+ENTER.

The entered formula first creates an array that includes only nonzero values in the range. The AVERAGE function then uses this array as its argument.

If you have any questions regarding this tip or need help implementing it in your own projects, contact Ranelle Maltas, Application Support Associate, at 472-0585 or e-mail at rmaltas2@unl.edu.

Previous Tip's Home Next