how to calculate the median on excel

Excel Median Calculator

Paste values below (comma, space, semicolon, or new-line separated), then click Calculate Median.

Tip: Avoid thousand separators (use 1200, not 1,200).

Quick answer: the median formula in Excel

To calculate the median in Excel, use the MEDIAN function: =MEDIAN(A2:A20). The median is the middle value after numbers are sorted. If you have an even number of values, Excel averages the two middle numbers.

Step-by-step: how to calculate median on Excel

Method 1: Basic median from a range

  • Place your numbers in a column (for example, cells A2 through A20).
  • Click an empty cell where you want the result.
  • Type =MEDIAN(A2:A20) and press Enter.

That’s it. Excel returns the center value of your dataset, which is often better than average when your data has outliers.

Example

Suppose your values are: 5, 8, 11, 13, 90. The average is pulled up by 90, but the median is still 11, which may represent the “typical” value better.

Median vs average in Excel: when median is better

Use median when your data is skewed or has extreme values (very high or very low numbers). Common cases:

  • Income and salary data
  • Home prices
  • Response times with occasional spikes
  • Product order sizes with a few huge orders

In these cases, MEDIAN often gives a more stable central value than AVERAGE.

How Excel treats blanks, text, and zeros

  • Blank cells: ignored in a referenced range.
  • Text in cells: ignored in a range reference.
  • Zeros: counted as valid numbers.

If your zeros are placeholders (not real values), exclude them before calculating median (see formula below).

Median excluding zeros

In many datasets, 0 means “no reading yet” rather than a true value. To calculate the median while excluding zeros:

=MEDIAN(IF(A2:A100<>0,A2:A100))

In older Excel versions, confirm this as an array formula with Ctrl + Shift + Enter. In Microsoft 365 / Excel 2021+, regular Enter is usually enough with dynamic array support.

Conditional median (median with criteria)

Modern Excel (recommended)

If column A has region and column B has sales, and you want median sales for only the “West” region:

=MEDIAN(FILTER(B2:B200, A2:A200="West"))

Legacy approach

=MEDIAN(IF(A2:A200="West",B2:B200))

Again, older Excel may require Ctrl + Shift + Enter.

Median for dates and times

Excel stores dates and times as numbers, so MEDIAN works on them directly. If your date median displays as a number, just format the result cell as Date.

Common problems and fixes

#NUM! error

Usually means there are no numeric values in the selected range after filters/conditions are applied.

Unexpected result

  • Check if zeros should be excluded.
  • Confirm you selected the intended range.
  • Verify numbers are real numeric values, not text-looking numbers.

Median looks different from what you expected

Remember: median is based on sorted position, not arithmetic balancing. It will often differ from average, especially with outliers.

FAQ

How do I find median in Excel quickly?

Use =MEDIAN(range), for example =MEDIAN(C2:C50).

Can I calculate median with multiple ranges?

Yes. Example: =MEDIAN(A2:A10, C2:C10, E2:E10).

Does MEDIAN ignore empty cells?

Yes, blank cells are ignored in range references.

Final takeaway

If you’re learning how to calculate the median on Excel, start with =MEDIAN(range). Then move to advanced formulas like FILTER + MEDIAN for conditional median calculations. This gives you cleaner insights than average when your data has outliers or skew.

🔗 Related Calculators