toolrota

Averages in Excel: the difference between AVERAGE, MEDIAN and AVERAGEIF

The mean is not always the right summary. When AVERAGE and MEDIAN differ, plus conditional and weighted averages with examples.

Serkan Akyürek·Updated ·3 min read
Averages in Excel: the difference between AVERAGE, MEDIAN and AVERAGEIF – Excel

Excel offers several ways to average; the right one depends on your data.

AVERAGE

=AVERAGE(B2:B100)

Divides the sum of the numbers by their count. It ignores blank and text cells, but cells containing 0 are counted, so a 0 in a cell you thought was empty pulls the average down.

MEDIAN: the middle value

=MEDIAN(B2:B100)

The number in the middle when values are sorted. It is not affected by outliers.

Example: salaries of 20,000, 22,000, 24,000, 26,000 and 150,000 give a mean of 48,400 but a median of 24,000. The median shows the "typical" value better. It is preferred for price, salary and housing data.

Conditional averages

=AVERAGEIF(A2:A100,"London",B2:B100)
=AVERAGEIFS(B2:B100,A2:A100,"London",C2:C100,">=50")

AVERAGEIF uses one condition, AVERAGEIFS several. If no cell matches you get #DIV/0!; wrap it in IFERROR.

Weighted average

When courses carry different credit weights, a plain average misleads:

=SUMPRODUCT(B2:B6,C2:C6)/SUM(C2:C6)

B holds grades, C credits. Use this for grade averages and weighted prices.

Excluding zeros

=AVERAGEIF(B2:B100,"<>0")

Common mistakes

  • Numbers stored as text: ignored. Check for the green triangle.
  • Averaging percentages: a plain mean of percentages on different bases can be wrong; calculate from the totals.
  • Filtered lists: AVERAGE includes hidden rows. For visible rows only, use SUBTOTAL(101,B2:B100).

Which to choose?

SituationUse
Evenly spread dataAVERAGE
Extreme values presentMEDIAN
Average by groupAVERAGEIF
Different weightsSUMPRODUCT / SUM

For totals and counts, see our SUMIFS and COUNTIF guides.

Step-by-step example: average, median and mode on salary data

Suppose a team's monthly salaries are in B2:B21 (20 people). Put three different "averages" side by side:

MeasureFormulaWhat it tells you
Arithmetic mean=AVERAGE(B2:B21)Total ÷ number of people
Median=MEDIAN(B2:B21)The middle salary (half below, half above)
Mode=MODE.SNGL(B2:B21)The most frequent salary
Lowest / highest=MIN(B2:B21), =MAX(B2:B21)The limits of the range

If there is a big gap between the mean and the median, your data has outliers. In that case the median is the more honest summary. To show the difference on a chart see our Excel charts guide.

Rounding and appearance

The mean often comes out with long decimals. You can shorten the look with cell format, or truly round the value with =ROUND(AVERAGE(B2:B21),0) (see our rounding guide). Where appearance is enough in reports prefer formatting; the full value stays in intermediate calculations.

Standard deviation: how spread out is the data?

The mean alone can mislead. To see how far data deviates from the mean use the standard deviation:

=STDEV.S(B2:B21)

A small deviation shows values close to the mean; a large one shows wide spread. Even if two groups have the same mean, if their deviations differ the groups' structures differ.

Frequently asked questions

Do blank cells affect the average? No, blanks are ignored. But cells with 0 typed in are counted.

How do I average a range that contains errors? =AGGREGATE(1,6,B2:B21) averages while ignoring error values; or clean the errors first (see our Excel errors guide).

How do I average only filtered rows? Use =SUBTOTAL(101,B2:B21); 101 gives the average of visible cells.

How do I look at the average without outliers? =TRIMMEAN(B2:B21,0.1) averages while leaving out the extreme 10% (5% at each end).

How often should I recalculate? If data keeps growing use an Excel table; formulas cover new rows automatically (see our Excel tables guide).

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.