FLXCode Median Calculator

FLXCode apps

Appearance

Median Calculator

Paste your numbers and get the median, with the sorted list and which values sit in the middle.

Paste a column or row from Excel, Google Sheets or a CSV file, or type numbers separated by spaces, commas or new lines. A header word is ignored.

Example Median

8.5 Median

Read 6 numbers.

Results
Median8.5
Count (n)6 (even)
Middle position3rd and 4th values
Smallest3
Largest14

The steps, with your numbers

Sort the numbers from smallest to largest: 3, 5, 8, 9, 12, 14

Count them: n = 6, which is even

With 6 numbers (even) there is no single middle one. The middle two 8 and 9 are at positions 3 and 4. Their average is (8 + 9) / 2 = 8.5

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

Quick start

  1. Paste or type the numbers, in any order. Spreadsheet columns work too.
  2. The median is the big number at the top. The steps show the sorted list and where the middle is.
  3. If the count is even, the tool shows the two middle values and their average.

The middle-position rule

Count (n)MedianExample
Oddthe value at position (n + 1) / 217 23 29 35 41 gives 29
Eventhe average of the values at n / 2 and n / 2 + 13 5 8 9 12 14 gives 8.5

Worked examples

NumbersCountMiddle positionMedianNote
8 3 12 5 9 1463rd and 4th values8.5Six numbers: the default list, an even count.
41 17 29 35 2353rd value29Five numbers in no order: sort first, then take the third.
2 2 3 3 3 4 10074th value3A data-entry slip (100) does not move the median.
711st value7One number is its own median.

In a spreadsheet

Use =MEDIAN(A1:A10) in Excel and Google Sheets. Text and empty cells are ignored, the same as here.

When you need more than the middle

The mean, median and mode calculator shows all three side by side. For the 25th and 75th percentiles and outliers, use the quartile calculator.

Numbers this uses

  • Even count is the average of the two middle values. The usual definition, the same as MEDIAN in Excel and Sheets.
  • Limit is 100,000 numbers. Kept low so the page stays quick on a phone.
  • Ties is repeated values each count. Nothing is removed before sorting.

Common mistakes

  • Taking the middle of the list without sorting it first.
  • Using the middle number of an even list instead of averaging the middle two.
  • Counting a header or a total row as part of the data.

In Excel and Google Sheets

Type the example numbers 8, 3, 12, 5, 9, 14 in cells A1 to A6. The formulas below work the same in both programs: every function name was checked against Google's function list.

TaskFormulaResult
Median=MEDIAN(A1:A6)8.5
Mean, for comparison=AVERAGE(A1:A6)–

You can also paste the column into the box above, or open an .xlsx or .csv file with the Open button, and use Download .xlsx to get these formulas filled in with your own numbers.

FAQ

What if there is an even number of values?

There is no single middle value, so you average the two in the middle. For 3, 5, 8, 9, 12, 14 the middle two are 8 and 9, and the median is 8.5. The tool names the two values in the steps.

How do I know which position the median is at?

With n numbers, the median of an odd count is at position (n + 1) / 2. For 9 numbers that is the 5th value. For an even count it sits between positions n / 2 and n / 2 + 1, so for 6 numbers between the 3rd and the 4th.

Does the median change if one value is huge or tiny?

Much less than the mean. In 2, 2, 3, 3, 3, 4, 100 the median is 3, while the mean is 16.7143. That is why the median is used for incomes and house prices.

Is the median the same as the 50th percentile?

Yes. Half the values are at or below it and half are at or above it. Excel and Google Sheets give it with =MEDIAN(A1:A10).

What about repeated values?

Repeats count once each, like any other number. For 4, 4, 4, 9 the sorted list has four entries, the middle two are 4 and 4, and the median is 4.

What does the tool do with text and blanks?

It skips anything that is not a number and says what it skipped. A word above the first number, such as a column name, is ignored.

More from FLXCode

Share Median Calculator