How to calculate the median in Excel with MEDIAN

To calculate the median in Excel, give MEDIAN the range that contains your numbers. With an odd count it returns the middle value. With an even count it averages the middle two values. You can leave the source data in its original order.

Use the MEDIAN function

If your numbers are in A2 through A10, enter the formula below in an empty cell. The first argument is required. A range works as a single argument, or you can supply individual numbers or references.

=MEDIAN(A2:A10)

Microsoft Support syntax and arguments for MEDIAN

Compare an odd and an even number of values

In a blank sheet, enter 1, 2, 3, 4, and 5 in A2:E2. Enter 1, 2, 3, and 4 in A3:D3. Put the first formula in F2 and the second in F3.

=MEDIAN(A2:E2)
=MEDIAN(A3:D3)

The first formula returns 3, the third of five values in numerical order. Rearranging the same five values does not change the answer.

For the second row, the middle values are 2 and 3, so the median is 2.5. The median of an even-sized set need not be a number in the original list.

See how blanks and zeros change the result

Continue the same exercise. Delete the 5 in E2 so that the cell is empty, and enter the number 0 in E3. Update both formulas so they include column E, as shown below.

=MEDIAN(A2:E2)
=MEDIAN(A3:E3)

The blank E2 leaves four numbers in the first row, giving a median of 2.5. The zero in E3 is included, giving five numbers and a median of 2. Record an observed zero separately from a missing measurement.

Excel also ignores text and logical values in a referenced range. If a value looks numeric but might be stored as text, use COUNT to check how many cells are numeric and convert only entries that really represent quantities. If the range contains errors, resolve their source first.

Compare the median with the arithmetic mean

In a new sheet, put 1, 2, and 100 in A2:A4. Use MEDIAN and AVERAGE in separate cells to summarize the same range.

=MEDIAN(A2:A4)
=AVERAGE(A2:A4)

The median is 2. The arithmetic mean is 103 divided by 3, or about 34.33. The unusually large value 100 pulls the mean up.

Use the median to describe the middle of the observations. Use the mean when you need the total divided by the observation count. Reporting both can clarify a skewed dataset. Label each statistic explicitly in the report.

Microsoft Support guide to AVERAGE