Median and Quartile Position

Also known as median position · position of the median · quartile locator · where is Q1 · n plus 1 over 4 · n plus 1 over 2 · which observation is the median

Lq=q(n+1)4L_q = \frac{q\,(n + 1)}{4}

Units aren’t used in this calculation — every value is a plain number.

Worked example: n = 11, median → position 6press Try an example to run it live, then adjust anything.

Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value.

Learning zone

Quartiles are found by position, not by value: sort the data, work out which observation you want, and read it off. The locator on this page is q(n+1)/4, so the median (q = 2) sits at (n+1)/2 and the lower quartile at (n+1)/4. Worked example: eleven sorted values put the median at (11+1)/2 = 6, the sixth observation, and Q₁ at 12/4 = 3, the third. With eight values instead, Q₃ lands at 3(8+1)/4 = 6.75 — three quarters of the way from the sixth observation to the seventh, so if those are 40 and 48 the quartile is 40 + 0.75(8) = 46.

The awkward truth is that there is no single right answer here. At least nine quartile conventions are in daily use, and on small samples they disagree by a whole observation. This one is the (n+1) locator — Hyndman and Fan's type 6, what Excel's PERCENTILE.EXC and most Canadian and British school texts use. Excel's older PERCENTILE.INC and R's default use 1 + p(n−1) instead; Tukey's hinges, the ones a hand-drawn box plot usually shows, split each half of the data at its own median and include the overall median when n is odd. None is wrong; they are different definitions of the same idea, and they converge as n grows. The practical rule is to say which you used, and never to compare a quartile from one convention against a quartile from another. The other trap is simpler: this page returns a position, not a data value. Position 6.75 is not the number 6.75.

Median and Quartile Position
Lq=q(n+1)4L_q = \frac{q\,(n + 1)}{4}
Where
  • LqL_q= Position in the sorted list
  • qq= Which quartile
  • nn= Number of observations
Missing one of these? Work it out first, then come back