# MEDIAN in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/median/

MEDIAN sorts the numbers and returns the middle one, or the average of the two middle ones when the count is even. It barely moves when one value is extreme, which makes it better than AVERAGE for order values and delivery times.

## Syntax

```
MEDIAN(value1, [value2, ...])
```

## Arguments

- `value1` (number, required: yes): The first number or range.
- `value2` (number, required: no): More numbers or ranges.

## Examples

The examples use this table, starting in A1:

| Value | Note |
|---|---|
| 3 | a |
| 9 | b |
| 1 | c |
| 7 | d |
| 100 | e |

```
=MEDIAN(A2:A6)
```

Result: `7`

Five values: the middle one after sorting. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=MEDIAN(A2:A5)
```

Result: `5`

Four values: the average of the two middle ones. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=AVERAGE(A2:A6)
```

Result: `24`

The average is pulled up by the 100. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=MEDIAN(A2:B6)
```

Result: `7`

Text cells in the range are ignored. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=MEDIAN(2, 8, A2)
```

Result: `3`

Single numbers and cells can be mixed. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- With an even count the result is the average of the two middle values, so it can be a number that is not in the data.
- Text inside a range is ignored. A text typed directly as an argument returns #VALUE!.
- A range with no numbers at all returns #NUM!.
- A number written as text inside an array is skipped, so "100" does not count in {"100";1;3}. Convert it with VALUE first.

## Compared with Excel

Same syntax in Excel.

## Related functions

- [AVERAGE](https://goingstellar.ro/reference/sheets/average/)
- [MODE](https://goingstellar.ro/reference/sheets/mode/)
- [SUM](https://goingstellar.ro/reference/sheets/sum/)
- [COUNT](https://goingstellar.ro/reference/sheets/count/)

## Sources

- [MEDIAN (Docs Editors Help)](https://support.google.com/docs/answer/3094025)

