How to calculate the median (and when to prefer it over average)
✓ Verified in LibreOffice 25.8.7.3Find the middle value of a data set — the robust alternative to AVERAGE.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel | =MEDIAN(A2:A100) | There's no MEDIANIFS — for a conditional median use =MEDIAN(FILTER(A2:A100,B2:B100="East")). |
| Google Sheets | =MEDIAN(A2:A100) | Identical, including the MEDIAN(FILTER(...)) pattern. |
| LibreOffice Calc | =MEDIAN(A2:A100) | Identical; FILTER needs 24.8+ for the conditional form. |
How it works
MEDIAN sorts the values internally and returns the middle one: 10, 20, 30, 40, 1000 → 30. Note how the 1000 outlier barely matters — the AVERAGE of the same data is 220, which describes nobody. That robustness is why salaries, house prices, and response times are usually reported as medians. With an even count it averages the two middle values. There's no built-in MEDIANIFS in any of the three apps — the FILTER pattern in the notes is the standard workaround.
Verified, not just documented
We ran =MEDIAN(A2:A6) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 30 — exactly the expected result. Every formula here is confirmed by actually executing it.