ShareYourGroupShareYourGroupExcel Formulas

Statistical functions

AVERAGE and MEDIAN functions in Excel

AVERAGE gives the arithmetic mean of a set of numbers; MEDIAN gives the middle value.

The average is the most quoted summary of a set of numbers: add them up and divide by how many there are. AVERAGE does both steps. What needs care is not the arithmetic but the question of which cells get counted.

Syntax

=AVERAGE(number1, [number2], ...)
=MEDIAN(number1, [number2], ...)
ArgumentWhat it is
number1, number2, ...Numbers, cells or ranges.

Examples

Each result below is what Excel itself showed for the formula on the sample sheet.

Sample sheet: Marks of eight students in three subjects. One Science mark is missing (cell D6 is empty).
ABCDE
1NameClassMathsScienceEnglish
2Asha8A788591
3Ravi8B455260
4Meena8A928879
5Kabir8B334138
6Tara8A6772
7Joy8B889084
8Neha8A546158
9Imran8B787369

What AVERAGE counts

AVERAGE adds up the numbers in the range and divides by the number of cells that contain numbers.

The second and third examples show why this matters. Tara has no Science mark. AVERAGE divides by 7. If a missing mark ought to count as zero, either type the zero or divide the SUM by the full number of students.

This is the single most important thing to understand about averages in a spreadsheet. An empty cell and a zero look similar and mean different things.

Average or median?

The average is pulled about by extreme values. If seven people earn 30,000 a month and one earns 5,00,000, the average is close to 89,000, a figure that describes none of them. The median, the middle value when the numbers are put in order, stays at 30,000.

Use the median when a few very large or very small values would give a false picture: incomes, house prices, waiting times. With an even number of values, MEDIAN returns the mean of the two middle ones.

There is also MODE.SNGL, which returns the value that occurs most often.

Averages of averages

Do not average a column of averages unless every group is the same size. A class of 10 with an average of 80 and a class of 40 with an average of 60 do not average 70 between them. The true figure is 64, because the second class has four times as many students. Go back to the original numbers, or weight the averages with SUMPRODUCT.

Averaging some rows only

For the average of the rows that meet a condition, such as the marks of one class, use AVERAGEIF and AVERAGEIFS.

To average the largest few values, combine with LARGE: =AVERAGE(LARGE(C2:C9,{1,2,3})) is the mean of the top three.

Errors

Display

Averages usually have long decimal tails. Use ROUND when the rounded figure will be used further, or the cell format when only the display matters.

In Google Sheets

AVERAGE and MEDIAN work the same way in Google Sheets.

Related functions

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.