How to Calculate Median in Excel (Formula + Example)

๐Ÿ“… Updated August 25, 2026 โฑ 6 min read โœ๏ธ By Anchor AI Tools
Excel spreadsheet with a column of numbers used to calculate the median

The median is the middle value in a sorted list of numbers โ€” and unlike the average, it isn't thrown off by a few unusually high or low values. Excel calculates it in one step with the built-in MEDIAN function, no manual sorting required.

This guide from Anchor AI Tools covers the basic formula, how to calculate a median with a condition, and when median gives you a more honest picture of your data than the average does.

Quick Answer: To calculate the median in Excel, use =MEDIAN(range) โ€” for example =MEDIAN(A2:A11). Excel automatically sorts the values and returns the middle one, or the average of the two middle values if the count is even. To find a median for only values matching a condition, use an array formula: =MEDIAN(IF(criteria_range=criteria,range)) entered with Ctrl+Shift+Enter.

What Is a Median?

The median is the middle value in a dataset once it's sorted from smallest to largest. If there's an odd number of values, the median is the single middle one. If there's an even number, the median is the average of the two middle values.

Because it only cares about the middle position, the median isn't dragged up or down by extreme outliers the way an average is โ€” which is why household income, home prices, and salary data are usually reported as medians rather than averages.

The MEDIAN Formula

=MEDIAN(range)

Excel sorts the values automatically and returns the middle one
// Median of values in A2:A11
=MEDIAN(A2:A11)

MEDIAN automatically ignores empty cells and text, so you don't need to clean the range first โ€” though it's still good practice to check what's actually in it.

Worked Example

A small business owner wants the typical sale amount from 9 recent transactions, one of which is an unusually large outlier order.

SaleAmount ($)
142
238
351
445
539
647
744
8950
941

๐Ÿ“‹ Formula Used

With amounts in B2:B10:

=MEDIAN(B2:B10)
Median: $44 ยท Average: $155.22

The $950 outlier order pulls the average up to $155.22 โ€” a figure that doesn't represent any typical sale. The median of $44 reflects what a normal transaction actually looks like.

Calculating a Conditional Median

Excel has no built-in MEDIANIF function, but you can build the same result with an array formula that combines MEDIAN and IF.

// Median of sales in B2:B10 where region (C2:C10) is "East"
=MEDIAN(IF(C2:C10="East",B2:B10))

In older Excel versions, confirm this formula with Ctrl+Shift+Enter instead of just Enter โ€” it needs to run as an array formula. In Excel 365 and Excel 2021, array formulas work automatically without the extra keystroke.

Median vs. Average: Which Should You Use?

Use Median WhenUse Average When
Your data has outliers (salaries, home prices, one-off large orders)Your data is fairly evenly distributed with no extreme values
You want the "typical" value, not the mathematical centerYou need every value to count equally toward the result
You're reporting on income, pricing, or duration dataYou're calculating totals, rates, or proportional splits

Common Mistakes to Avoid

Assuming median and average will match. They're only equal when data is perfectly symmetrical โ€” in most real datasets, they differ, sometimes significantly.

Forgetting Ctrl+Shift+Enter for conditional medians. In older Excel versions, a conditional MEDIAN(IF(...)) formula entered normally can return an error or wrong result instead of the array calculation.

Including header rows or labels in the range. Text in the selected range is ignored by MEDIAN, but it's still worth double-checking your range starts at the first data row.

Using median when you actually need a total. Median describes a typical value โ€” it's not additive, so you can't use it to estimate a sum or total the way you could with a count times an average.

Who Needs to Calculate Median in Excel?

This comes up for small business owners looking at typical sale size, HR teams reporting median salary instead of a skewed average, real estate professionals discussing median home prices, and analysts summarizing survey or performance data that includes outliers.

Looking at variability instead of typical value? See our guide on standard error in Excel. Testing whether a difference between two groups is real? See how to calculate a p-value in Excel.

Need more free calculators and formula guides?

Explore Free Tools โ†’

Frequently Asked Questions

What's the difference between median and average in Excel?
Average (AVERAGE) adds all values and divides by the count. Median (MEDIAN) finds the middle value once sorted. Median is less affected by outliers.
Does MEDIAN ignore blank cells?
Yes. MEDIAN automatically ignores blank cells and text values in the selected range, so you don't need to remove them first.
How do I find the median of an even number of values?
MEDIAN handles this automatically โ€” it returns the average of the two middle values once the data is sorted. You don't need a different formula.
Is there a MEDIANIF function in Excel?
No built-in one exists. Use the array formula =MEDIAN(IF(criteria_range=criteria,range)), confirmed with Ctrl+Shift+Enter in older Excel versions.
Can I calculate median across multiple columns or ranges?
Yes. You can reference multiple ranges in one formula, such as =MEDIAN(A2:A10,C2:C10), and Excel treats them as one combined dataset.
Does Google Sheets use the same MEDIAN formula?
Yes. Google Sheets supports MEDIAN with identical syntax, including array-based conditional medians.

Related Free Guides & Tools From Anchor AI Tools

โš ๏ธ Accuracy Note: This guide explains standard statistical formulas for planning and educational purposes. For research, financial, or regulated reporting, confirm your method and results with a qualified professional.
A
Anchor AI Tools Editorial Team

We build free, fast, and accurate online tools and guides that explain the answer โ€” not just show a number. Used by students, analysts, marketers, and small businesses every day.

Published by Anchor AI Tools ยท ยฉ 2026 Anchor AI Tools