Number
sorter.
Sort any pasted list of numbers and see its repeats, median and outliers.
23 sits far below the rest (past the 1.5 × IQR fence), so check it before trusting the mean. The mean (76.36) is below the median (85), pulled down by the low values. 85 is the only repeated value.
Where the values fall
Click a stack of dotsThe 6th value from the bottom is 85. It appears 3 times, at ranks 6 to 8 low to high, and first at position 2 of your list.
Dot plot of 11 values from 23 to 99, one dot per value; 85 is a stack of 3. Middle half from 71 to 86.5, median 85. Outliers (rings): 23.
Working
- 1Read the list11 numbers, from 23 to 99
- 2Put them in order, low to high23, 64, 70, 72, 78, 85, 85, 85, …
- 3Note the repeats85, which appears 3 times
- 4Median: the middle of the list, low to highposition 6: 85
- 5Quartiles: a quarter and three quarters of the way alongQ1 at position 3.5: 70 + 0.5 × (72 − 70) = 71Q3 at position 8.5: 85 + 0.5 × (88 − 85) = 86.5
- 6Outlier fences: 1.5 × IQR beyond the quartilesIQR = 15.5; fences 47.75 and 109.75; outside: 23
- 7Most common value and spreadMode: 85; sample standard deviation: 20.37
- 8Check: nothing lost, every neighbor in order11 numbers out (11 in); sum 840 before and 840 after; each value is in order with the next
Each value
| Ranks | |||
|---|---|---|---|
| 23 | 1 | 1 | 10 |
| 64 | 1 | 2 | 4 |
| 70 | 1 | 3 | 9 |
| 72 | 1 | 4 | 1 |
| 78 | 1 | 5 | 6 |
| 85 | 3 | 6 to 8 | 2 |
| 88 | 1 | 9 | 11 |
| 91 | 1 | 10 | 3 |
With and without outliers
| Figure | All values | Without outliers |
|---|---|---|
| Count | 11 | 10 |
| Mean | 76.36 | 81.7 |
| Median | 85 | 85 |
| Std dev (sample) | 20.37 | 10.63 |
| Range | 76 | 35 |
Leaving out 23 moves the mean from 76.36 to 81.7; the median stays at 85. The median notices extreme values less than the mean does.
How it’s worked out
The box takes numbers split by commas, spaces, semicolons, tabs or new lines, so a column pasted from a spreadsheet works as it is. Negatives, decimals and e notation such as 2.5e-3 are read as numbers. Then every value is compared by its size, never by its first digit.
Three orders. Low to high puts the smallest first. High to low reverses it. By size ignores the minus sign and orders by distance from 0, which suits errors or price changes where the size matters more than the direction. When two values have the same size, such as −3 and 3, the negative one comes first.
The median and quartiles. With the list sorted low to high, the value at a fraction p of the way along sits at position h:
Here n is how many numbers there are. The median uses p = 0.5, the first quartile Q1 uses 0.25 and the third quartile Q3 uses 0.75. When h falls between two positions, the tool goes that part of the way from one value to the next. For 1, 2, 4, 7, 8, 9, 10, 12 the median sits at position 4.5, halfway from 7 to 8, so it is 7.5. This is rule 7 in Hyndman and Fan's survey, the one Excel's QUARTILE.INC uses.
Outliers. The gap from Q1 to Q3 is the interquartile range (IQR), the spread of the middle half. A value more than 1.5 IQRs below Q1 or above Q3 is flagged. This is John Tukey's rule for box plots, and the dot plot draws those values as rings.
The check. A sort must not lose or invent a value. The last step of the working counts the numbers and adds them up before and after, and confirms that each value is in order with the next.
Worked examples
A teacher sorts quiz scores
Ms. Ortiz copies eleven scores from her gradebook: 72, 85, 91, 64, 85, 78, 99, 85, 70, 23, 88. Low to high they read 23, 64, 70, 72, 78, 85, 85, 85, 88, 91, 99. The score 85 appears 3 times, at ranks 6 to 8.
The median is the 6th value, 85. Q1 sits at position 3.5, between 70 and 72, so it is 71; Q3 is 86.5. The lower fence is 47.75, which puts 23 well outside. Leaving it out moves the mean from 76.4 to 81.7, while the median stays at 85. She checks whether 23 was a typo before she reports the class average.
A spreadsheet column that sorted wrong
Dev pastes a column of order sizes, 100, 9, 25, 1000, 3, 42, into a sheet that stores them as text. The sheet sorts them as 100, 1000, 25, 3, 42, 9, because it compares the first character, and 1 comes before 2. Sorted by value they are 3, 9, 25, 42, 100, 1000. Choose Lines under Copy as, press Copy result, and paste the column back.
Ordering winter lows from least to greatest
A worksheet asks for the week's low temperatures in order: −3.5, 2, −8, 0, 4.5, −1, 7. Low to high gives −8, −3.5, −1, 0, 2, 4.5, 7; the coldest night, −8, comes first because it is the farthest below zero. High to low gives 7, 4.5, 2, 0, −1, −3.5, −8. By size, ignoring the sign, the order is 0, −1, 2, −3.5, 4.5, 7, −8.
Reading your result
The sorted list. The answer shows the first 40 values; Copy result copies them all, split by commas, spaces or new lines as you choose. Remove repeats keeps one copy of each value, so the raffle tickets 412, 87, 412, 230, 87, 905, 412, 66 become 66, 87, 230, 412, 905, with 3 repeats dropped. The tiles and the working still count all 8.
Mean against median. The mean adds every value and divides by the count, so one extreme value drags it. The median is just the middle value. When the mean sits well below the median, as with the quiz scores (76.4 against 85), a few low values are pulling it down. The sentence under the answer says which way yours leans.
The dot plot and box plot. Each dot is one value, and repeated values stack up. The box spans Q1 to Q3, the thick line is the median and the whiskers reach the last values inside the fences. Pick a rank with the slider to read off the 3rd highest or 10th lowest value.
Flagged is not wrong. An outlier is a value worth a second look, not an error. A 23 among scores in the 60s to 90s might be a typo for 73, or a student who missed most of the quiz. The table under the tool shows how much the mean and spread change without it.
Common mistakes
- Typing thousands with commas. A comma splits two numbers, so 1,000, 25 is read as 1, 0, 25. Write 1000, or paste one number per line. Up to 10,000 numbers fit in one list.
- Sorting numbers as text. Text order puts 1000 before 25 and 10 before 9. If a spreadsheet does this, the cells are text; paste them here or convert them to numbers first.
- Forgetting that negatives run backward. −8 is smaller than −1, so it comes first low to high, even though 8 is bigger than 1.
- Reading the middle of an even list. With 8 values there is no single middle one. The median is halfway between the 4th and 5th values, which is 7.5 for 1, 2, 4, 7, 8, 9, 10, 12.
- Expecting your textbook's quartiles. Some books split the list into two halves and take the median of each. For short lists that can differ from the rule here by a fraction of a step, so say which rule you used.
Questions people ask
Sources
- Rob J. Hyndman and Yanan Fan, Sample Quantiles in Statistical Packages, The American Statistician 50(4), 1996, pp. 361 to 365 (definition 7)
- John W. Tukey, Exploratory Data Analysis (Addison-Wesley, 1977), chapter 2 (box plots and the 1.5 × IQR fences)
- Microsoft Support, QUARTILE.INC function (worked example with data 1, 2, 4, 7, 8, 9, 10, 12)