ExcelTool.io

MEDIAN Formula Generator

Find the middle value of a range, the point half your numbers sit above and half below.

MEDIAN

Find the middle value of a range, the point half your numbers sit above and half below.

Math

The cells to find the middle value of. Text, logical values, and empty cells are ignored; zeros are counted.

=MEDIAN(A2:A100)

Worked Example

Four support response times in A2:A5: 12, 15, 18, and 22 minutes.

=MEDIAN(A2:A5)

Returns: Returns 16.5. With an even count there is no single middle value, so MEDIAN averages the two middle numbers, 15 and 18.

Checks Before You Paste

  • With an even count of numbers, MEDIAN averages the two middle values, so the answer can be a number that appears nowhere in your data: 12 and 18 in the middle produce 15.
  • MEDIAN ignores text, TRUE/FALSE, and truly empty cells inside a range, but a cell holding 0 is a real number and counts. That blank-versus-zero distinction is the usual reason a median shifts after someone fills in the gaps.
  • MEDIAN is the 50% point of the data, so QUARTILE.INC(range, 2) returns exactly the same number while quart 1 and 3 give the quarter points. For the most common value use MODE.SNGL, which returns #N/A when nothing repeats, or MODE.MULT to list every tied winner - it spills down several cells in Microsoft 365 and needs Ctrl+Shift+Enter over a selected range in older Excel versions.

How MEDIAN works

Availability: Every version of Excel, Excel for the web, Google Sheets and LibreOffice Calc. The MEDIAN with FILTER pattern below needs Excel 2021 or Microsoft 365; the MEDIAN with IF version works everywhere but needs array entry in Excel 2019 and earlier.

MEDIAN sorts your numbers internally and returns the one in the middle: half the values sit at or below it, half at or above. With an even count there is no single middle value, so it averages the two nearest the centre - which is why a median can be a number that appears nowhere in the data, and why a median of whole numbers can come out as 16.5.

The reason to prefer it over AVERAGE is skew. One founder's salary, one enterprise contract or one 40-minute support call moves a mean a long way and a median barely at all. Salaries, house prices, response times, order values and anything else with a long tail are almost always reported as medians for exactly that reason. The mean is still the right summary when the values are roughly symmetrical, and it is the only one of the two that can be combined arithmetically - you can add means together, or weight them; medians of subgroups tell you nothing about the median of the whole.

Inside a range reference, MEDIAN ignores text, TRUE/FALSE and genuinely empty cells, and counts zeros as real numbers. That blank-versus-zero distinction is the usual reason a median jumps after somebody fills the gaps in with zeros. Values typed directly as arguments are treated differently: =MEDIAN(TRUE, 3, 5) counts TRUE as 1 and returns 3, whereas the same three entries in cells would give 4.

Excel has no MEDIANIF. A conditional median is built by feeding IF into MEDIAN, which passes an array of matching values and FALSE placeholders that MEDIAN then skips. In Microsoft 365 and Excel 2021 you can type it normally, or use MEDIAN(FILTER(...)), which reads better; in Excel 2019 and earlier the IF version must be committed with Ctrl+Shift+Enter or it returns the wrong single value.

Syntax

=MEDIAN(number1, [number2], ...)
ArgumentRequiredWhat it does
number1RequiredThe first number, cell reference or range. A single range such as A2:A100 is the usual form.
number2, ... number255OptionalFurther numbers or ranges, up to 255 arguments, pooled into one set before the middle is found. =MEDIAN(A2:A50, D2:D50) gives the median of both columns combined, not the median of their two medians.

More worked examples

Five salaries in A2:A6: 42,000, 45,000, 47,000, 51,000 and 240,000 - the last being a founder still on the payroll.

=MEDIAN(A2:A6)

Returns: Returns 47000. =AVERAGE(A2:A6) returns 85000, a figure nobody in the list is paid.

With an odd count the median is an actual value from the data, which makes it easy to sanity-check against the sheet.

A2:A6 holds 5, 0, an empty cell, 9 and 7 - the empty cell is a survey question nobody answered.

=MEDIAN(A2:A6)

Returns: Returns 6. Four numbers are counted (0, 5, 7 and 9) and the two middle ones, 5 and 7, are averaged.

Type a 0 into the empty cell and the answer changes to 5, because there are now five values and the middle one is 5.

Deal sizes in B2:B50 with the region in A2:A50, and you want the median for the West region only.

=MEDIAN(IF($A$2:$A$50="West", $B$2:$B$50))

Returns: With West deals of 10,000, 14,000 and 22,000, returns 14000.

In Excel 2019 and earlier this must be entered with Ctrl+Shift+Enter. In Microsoft 365, =MEDIAN(FILTER($B$2:$B$50, $A$2:$A$50="West")) does the same thing and is easier to read.

Common mistakes

Numbers stored as text are dropped from the count
A column pasted from a PDF or a web table can arrive as text, and MEDIAN ignores every text entry inside a range without erroring. Removing half the values moves the middle. Compare =COUNT(range) with =COUNTA(range); if they differ, convert the column before trusting the median.
A numeric header inside the range
Whole-column references are safe when the header is text, because MEDIAN skips it, but a header such as 2026 or a row of month numbers is a genuine number and joins the data set. Start the range at the first data row rather than relying on the header being ignored.
The conditional median entered as a normal formula
In Excel 2019 and earlier, =MEDIAN(IF(A2:A50="West", B2:B50)) typed with Enter returns the value from the row the formula happens to sit beside, or #VALUE!. Press Ctrl+Shift+Enter so the braces appear, or move to a version with dynamic arrays and use FILTER.
Medians that cannot be recombined
A median of four regional medians is not the median of the whole company, and no weighting fixes it - the information needed is not in the four numbers. Always compute the median from the underlying rows, which is why conditional medians usually have to be recalculated rather than aggregated.
A middle value that is not a valid value
On a one-to-five rating scale with an even number of responses, the median can come out as 3.5, which is not a rating anyone can give. That is arithmetically correct but often misleading in a report; quote the count alongside it, or use MODE.SNGL when the summary has to be an actual scale point.

Frequently Asked Questions

Related Tools