Contact

QUARTILE.EXC Function (LibreOffice Calc)

Math Intermediate LibreOffice Calc LibreOffice 4.3

Calculate exclusive quartiles in LibreOffice Calc with worked interpolation, minimum sample sizes, and checks for unexpected results.

Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked

Calculate exclusive quartiles in Calc

QUARTILE.EXC returns the lower quartile, median, or upper quartile of numeric data. Exclusive does not mean deleting the smallest and largest observations. Those observations remain in the calculation and can determine the answer.

Use the quartile convention required by your analysis, report, or comparison dataset. Neither the exclusive nor the inclusive convention is inherently more rigorous. State which you used so another person can reproduce your result.

Availability and verification scope

The LibreOffice function reference, labeled 26.8 when checked on 2026-10-23, says this function was introduced in LibreOffice 4.3. The LibreOffice 26.8.1.1 function registry contains its entry. A registry entry is source evidence of availability, not a native test of that release.

This guide covers desktop Calc with English function names and semicolon argument separators. The examples below were independently checked mathematically; they were not executed in Calc for this revision. The interpolation implementation was also inspected at commit 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, associated with the available LibreOfficeDev 26.8.0.0.alpha0 build. That source check does not establish execution in 26.2 or 26.8.1.1. No screenshot or cross-application round trip is claimed.

Syntax and inputs

=QUARTILE.EXC(Data; Type)
  • Data: the cell range containing the observations.
  • Type: enter integer 1 for Q1 (25%), 2 for the median (50%), or 3 for Q3 (75%). Use these integers explicitly rather than relying on conversion of other inputs.
  • For Q1 or Q3, the Help requires more than two data values. With only two numbers, the median is still meaningful but those exclusive outer quartiles cannot be calculated.

For a clean numeric range and an integer Type of 1, 2, or 3, =PERCENTILE.EXC(Data;Type/4) uses the same percentile convention. See the PERCENTILE.EXC guide.

Worked example: six observations

Enter this complete sample in A1:A7. A1 is a header, not an observation.

Cell Entry
A1 Measurement
A2 10
A3 20
A4 30
A5 40
A6 50
A7 60

Enter these formulas in separate empty cells:

Formula Expected result
=QUARTILE.EXC(A2:A7;1) 17.5
=QUARTILE.EXC(A2:A7;2) 35
=QUARTILE.EXC(A2:A7;3) 52.5
=PERCENTILE.EXC(A2:A7;0.25) 17.5
=QUARTILE.EXC(A2:A7;3)-QUARTILE.EXC(A2:A7;1) 35

The last formula calculates the interquartile range, Q3 minus Q1. These six invented measurements are a reproducible exercise, not research data.

How interpolation produces the answers

For sorted observations x1 through xn and percentile p, use the one-based exclusive rank r = (n + 1) × p. When r lies between positions, interpolate linearly. The pinned Calc implementation shows the rank bounds and interpolation.

For the six-value sample:

  • Q1: r = 7 × 0.25 = 1.75. Start at 10 and move 75% of the distance to 20: 10 + 0.75 × (20 − 10) = 17.5.
  • Median: r = 7 × 0.5 = 3.5. Halfway between 30 and 40 gives 35.
  • Q3: r = 7 × 0.75 = 5.25. Start at 50 and move 25% of the distance to 60: 50 + 0.25 × (60 − 50) = 52.5.

Do not round the rank up and simply select that observation. Selecting position 2 for Q1 would give 20, not 17.5. Sorting is useful for checking the calculation by hand; the original range need not be sorted for the function.

Prove that the endpoints still matter

On a disposable copy of the six-value example, change A2 from 10 to 0. Q1 becomes 15, because 0 + 0.75 × (20 − 0) = 15. Restore A2 to 10.

Then change A7 from 60 to 100. Q3 becomes 62.5, because 50 + 0.25 × (100 − 50) = 62.5. Restore A7 to 60. These checks would not change the answers if the minimum and maximum had actually been removed.

Small samples and invalid requests

Use a separate sheet for these controls. Enter 10, 20, 30 in A1:A3.

Formula Expected outcome
=QUARTILE.EXC(A1:A3;1) 10, the minimum
=QUARTILE.EXC(A1:A3;2) 20
=QUARTILE.EXC(A1:A3;3) 30, the maximum
=QUARTILE.EXC(A1:A2;2) 15
=QUARTILE.EXC(A1:A2;1) Error: too few observations for Q1
=QUARTILE.EXC(A1:A2;3) Error: too few observations for Q3
=QUARTILE.EXC(A1:A3;0) Error: unsupported Type
=QUARTILE.EXC(A1:A3;4) Error: unsupported Type

With three observations, the exclusive Q1 and Q3 ranks are exactly 1 and 3. They can therefore equal the minimum and maximum. With two observations, their ranks would be 0.75 and 2.25, outside the available positions. This guide deliberately does not prescribe an untested displayed error code for those cases.

QUARTILE.EXC versus QUARTILE.INC

For the original six observations, the inclusive rank is 1 + (n − 1) × p, rather than (n + 1) × p. At 25% and 75%, it gives ranks 2.25 and 4.75.

Method Q1 Median Q3 Interquartile range
EXC 17.5 35 52.5 35
INC 22.5 35 47.5 25

Check with =QUARTILE.INC(A2:A7;1) and =QUARTILE.INC(A2:A7;3) on the original sheet. The QUARTILE.INC guide covers the inclusive alternative. Unlike EXC, the Help defines INC Types 0 and 4 as minimum and maximum.

Troubleshoot an unexpected result

  1. Check the convention. Comparing EXC against INC can legitimately produce different outer quartiles, as the table shows. Check the source report’s method before changing formulas.
  2. Check the actual range and numeric count. For the first example, =COUNT(A2:A7) should be 6. A result below 6 indicates that the range no longer contains six numeric entries. Check imports for numeric-looking text; do not silently replace missing data with zero.
  3. Separate sample-size problems from Type problems. Use Type 1, 2, or 3 explicitly, and ensure Q1/Q3 have at least three numeric observations. Do not use Type 0 or 4 to request endpoints; use MIN/MAX separately.
  4. Check source errors before calculating. Inspect error cells and resolve their cause rather than replacing every error with zero or wrapping the result in a blanket IFERROR. Such replacements change the dataset or conceal the failure.
  5. Define the intended population. If the analysis must exclude particular records, create and check a separate numeric input range containing exactly those records. Do not assume hiding or filtering rows changes which observations this formula should use.
  6. Check number display. Show sufficient decimal places to see 17.5 and 52.5 in this example. Display rounding is not a reason to replace interpolation with a rounded rank.

Saving and sharing

The Help lists the namespace COM.MICROSOFT.QUARTILE.EXC and says the function is not part of OpenFormula 1.3. That is a format-standard statement, not proof that any particular recipient application supports or rejects it. Preserve a working copy, then reopen the intended exchange format in the exact receiving application and check the example values and formula text. Recipient compatibility and native file-conversion behavior remain untested here.