Grouped Data Quartile Calculator - Q1, Median, Q3, IQR

    Only have a frequency table with classes and counts? Get Q1, the median, Q3 and any percentile by interpolation, with the cumulative table, every step written out, and gaps or open classes handled.

    Parameters

    Enter data for calculations

    One class per line, then its count

    Shown in the result heading

    All three shows the full calculation

    Use the one your textbook uses

    Only matters for tables like 10-19, 20-29

    Automatic follows the class width

    Form progress0 / 4 fields

    💡 Fill in all required fields to unlock the calculate button

    Quartiles of grouped data, straight from a frequency table

    When the data arrive as classes and counts, such as 160-165 cm: 18 people, the raw values are gone and a quartile has to be estimated inside its class. This grouped data quartile calculator finds Q1, the median and Q3 by linear interpolation, prints the cumulative frequency table with the quartile classes marked, and writes out each step. It also handles what textbook tables and census tables actually contain: gaps such as 10-19 and 20-29, an open first or last class such as "under 20" or "65+", and classes of different widths. Any percentile or decile works the same way.

    161.11
    Q1 of 80 heights in six classes
    166.25
    the grouped median
    170.63
    Q3, with an IQR of 9.51

    Four steps from a class table to Q1, the median and Q3

    1. Paste the table, one class per line: the interval, then its frequency, as in 160-165; 18. A space, tab, colon or "160 to 165" also work. Open classes go first as under 150; 3 or last as 180+; 2.
    2. Pick the statistic: all three quartiles, one of them, or a percentile from 1 to 99 (10, 20 and so on give the deciles).
    3. Pick the position rule your course or source uses, k × N / 4 or k × (N + 1) / 4, and whether gaps between classes are closed with class boundaries.
    4. Read the quartiles, the interquartile range, the quartile deviation and Bowley skewness, then check the marked classes in the cumulative table.

    The grouped quartile formula on one card

    Qk = L + (k × N / 4 - CF) / f × h
    L lower boundary of the quartile class
    N total frequency
    CF cumulative frequency before the class
    f frequency of the class
    h width of the class
    k 1, 2 or 3 for Q1, the median, Q3

    The quartile class is the first one whose cumulative frequency reaches the position k × N / 4. The formula assumes the observations inside that class are spread evenly, which is why a grouped quartile is an estimate and quartiles from the raw values usually differ slightly. For a percentile, replace k / 4 with the percentage divided by 100.

    Eighty heights in six classes

    Height (cm) Frequency Cumulative Holds
    150-15544
    155-1601216
    160-1651834Q1, position 20
    165-1702458Median, position 40
    170-1751674Q3, position 60; P90 at 72
    175-180680
    Q1 = 160 + (20 - 16) / 18 × 5 = 161.11
    Median = 165 + (40 - 34) / 24 × 5 = 166.25
    Q3 = 170 + (60 - 58) / 16 × 5 = 170.63
    P90 = 170 + (72 - 58) / 16 × 5 = 174.38

    The interquartile range is 170.63 - 161.11 = 9.51 cm, the quartile deviation half of that, 4.76. Bowley skewness, (Q3 + Q1 - 2 × median) / IQR, is -0.080: the middle half of the heights is close to symmetric.

    Gaps, open ends and uneven widths

    Gaps: 10-19, 20-29
    With class boundaries the classes become 9.5-19.5, 19.5-29.5 and so on. For ages 10-59 in five classes of 5, 12, 20, 9 and 4 people, Q1 is 25.75 with boundaries and 25.63 with the limits as typed.
    Open ends: under 20, 50+
    An open class has no width. A quartile, though, rarely falls in it. The calculator computes every quartile it can and says plainly when one lands in the open class, instead of inventing a limit.
    Uneven widths: 0-10, 10-30
    The formula uses each class's own width. The bars in the result show frequency per unit of width, so a wide class is not drawn as if it were crowded.

    N / 4 or (N + 1) / 4: how far apart the answers land

    Table and rule Q1 Median Q3 IQR
    80 heights, k × N / 4161.11166.25170.639.51
    80 heights, k × (N + 1) / 4161.18166.35170.869.68
    50 ages, k × N / 425.7533.5040.0614.31
    50 ages, k × (N + 1) / 425.9633.7540.8914.93

    Most statistics textbooks use N / 4 for grouped data; some exam boards and older texts use N + 1. The gap shrinks as N grows, so it only matters when your answer has to match a marking scheme.

    Grouped quartile questions

    How do I find the median class?
    Work out N / 2 and go down the cumulative frequency column until it first reaches that number. For 80 heights the position is 40; the cumulative count is 34 after 160-165 and 58 after 165-170, so 165-170 is the median class.
    Can I read the quartiles off an ogive instead?
    Yes. An ogive joins the cumulative frequencies at the upper class boundaries with straight lines, and reading across at N / 4, N / 2 and 3N / 4 gives exactly the interpolated values printed here, up to the accuracy of your drawing.
    What is the quartile deviation?
    Half the interquartile range, (Q3 - Q1) / 2, also called the semi-interquartile range. For the heights it is 4.76 cm. Like the IQR it ignores the extreme classes, which makes it a better spread measure than the range for tables with open ends.
    Why does my grouped answer differ from the quartile of the raw data?
    Grouping throws away where each value sat inside its class, and the formula replaces that with an even spread. The difference is usually a fraction of the class width. With the raw values, use the interquartile range calculator, which also shows how Excel, R and a TI-84 disagree.

    Related tools

    Confidence Interval Calculator

    An interval for a mean or a proportion once you have the raw values or a summary - See calculator

    Standard Error Calculator

    How precisely a mean or a rate is known, from data, an SD and n, or a report - See calculator

    Interquartile Range Calculator

    Quartiles, IQR and outlier fences from a raw list, under five software conventions - See calculator

    Percentile Calculator

    Any percentile or percentile rank from a list of values - See calculator

    Mode Calculator

    The most frequent value, and the modal class with its grouped estimate - See calculator

    Median Calculator

    The middle value of a plain list of numbers - See calculator

    Skewness Calculator

    Moment-based skewness with a significance test, next to Bowley's quartile measure used here - See calculator

    Similar calculators from this section