# MEDIAN function in Excel

> MEDIAN returns the middle value once the numbers are sorted.

Source: https://spreadsheetpractice.com/functions/median · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** MEDIAN returns the middle value once the numbers are sorted.
- **Syntax:** `=MEDIAN(number1, [number2], ...)`
- **Most common use:** `=MEDIAN(B2:B6)` returns 4 (Typical delivery time; the 21-day order barely affects it)
- **Available in:** Every current version
- **Category:** [Statistical functions](https://spreadsheetpractice.com/functions/category/stats)
- **Returns:** The middle number. With an even count of numbers, the average of the two in the middle.
- **Google Sheets:** Also available in Google Sheets.

## What it does

MEDIAN returns the middle value once the numbers are sorted. Half the values are above it and half below, so a single extreme number barely moves it. That makes it a better "typical" figure than AVERAGE for things like delivery times, house prices or salaries.

## Syntax

`=MEDIAN(number1, [number2], ...)`

| Argument | Required? | What it is |
|---|---|---|
| `number1` | Required | The first number, cell or range. |
| `number2` | Optional | More numbers, cells or ranges, up to 255 in total. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| F2 | `=MEDIAN(B2:B6)` | 4 | Typical delivery time; the 21-day order barely affects it |
| F3 | `=AVERAGE(B2:B6)` | 7 | The average for comparison, pulled up by one late order |
| F4 | `=MEDIAN(B2:B5)` | 3.5 | With four values, the median is the average of the middle two |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Order | Delivery days |  |  | Check | Result |
| 2 | A-1 | 2 |  |  | Median | 4 |
| 3 | A-2 | 3 |  |  | Average | 7 |
| 4 | A-3 | 4 |  |  | First four orders | 3.5 |
| 5 | A-4 | 5 |  |  |  |  |
| 6 | A-5 | 21 |  |  |  |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| The median looks like a number that isn't in the list | With an even number of values, MEDIAN averages the two middle ones. That's correct behavior. |
| Blank cells change the result | They don't: MEDIAN skips empty cells. Zeros are included, though, so a 0 meaning "no data" will drag the median down. |

## Tips

- Report the median and the average together. A big gap between them tells you the data has outliers.

## Related functions

- [AVERAGE](https://spreadsheetpractice.com/functions/average): AVERAGE adds up the numbers you give it and divides by how many numbers there are.
- [MODE](https://spreadsheetpractice.com/functions/mode): MODE returns the number that appears most often in a list, such as the most common shoe size or order quantity.

## Questions

### When should I use MEDIAN instead of AVERAGE?

When a few very large or very small values would distort the average, such as salaries, prices or response times.

### Does the data need to be sorted for MEDIAN?

No. MEDIAN sorts the values internally.

## Practice

A graded MEDIAN exercise ("Typical deal size per rep") is on [the MEDIAN page](https://spreadsheetpractice.com/functions/median). It is checked instantly, then re-checked on changed data.

Lessons that use MEDIAN:

- [Lesson 37: Median, quartiles & outliers](https://spreadsheetpractice.com/learn/median-quartiles-outliers) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
