Contact

QUARTILE.INC Function (LibreOffice Calc)

Math Intermediate LibreOffice Calc LibreOffice 4.3

Calculate inclusive quartiles in Calc with complete examples, interpolation checks, and comparisons with exclusive quartiles.

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

Calculate inclusive quartiles

QUARTILE.INC returns Q1, the median, or Q3 using inclusive percentile ranks. It also accepts explicit integer Types 0 and 4 to request the minimum and maximum. “Inclusive” describes the percentile convention; it does not mean that EXC removes the smallest and largest input values.

Syntax

=QUARTILE.INC(Data; Type)

Use a nonempty numeric cell range for Data. Enter Type as an integer: 0 = minimum, 1 = Q1, 2 = median, 3 = Q3, 4 = maximum. Use these explicit integers rather than relying on conversion of fractional or nonnumeric inputs.

For this numeric scope and those integer Types, =PERCENTILE.INC(Data;Type/4) gives the same result. See PERCENTILE.INC for arbitrary percentiles.

Worked example: four measurements

Enter the complete invented dataset below. A1 is a header, excluded from the formulas.

Cell Entry
A1 Measurement
A2 10
A3 20
A4 40
A5 80
Formula Expected result
=QUARTILE.INC(A2:A5;0) 10
=QUARTILE.INC(A2:A5;1) 17.5
=QUARTILE.INC(A2:A5;2) 30
=QUARTILE.INC(A2:A5;3) 50
=QUARTILE.INC(A2:A5;4) 80
=PERCENTILE.INC(A2:A5;0.75) 50
=QUARTILE.INC(A2:A5;3)-QUARTILE.INC(A2:A5;1) 32.5

The final formula is the interquartile range, Q3 minus Q1.

Check the interpolation

For n sorted observations and percentile p = Type/4, the one-based rank is 1 + (n − 1) × p. The original input need not be sorted; sorting simply makes the manual check easier.

  • Q1: rank 1 + 3 × 0.25 = 1.75. Interpolate 75% from 10 to 20: 17.5.
  • Median: rank 2.5, halfway from 20 to 40: 30.
  • Q3: rank 3.25, 25% from 40 to 80: 50.

Rounding Q3’s rank up selects 80; rounding n × 0.75 up selects 40. Neither is the interpolated result 50. Do not use a SORT/INDEX/ROUNDUP shortcut as an equivalent quartile formula.

On a disposable copy, change A2 from 10 to 0: Q1 becomes 15. Restore A2, then change A5 from 80 to 120: Q3 becomes 60. Restore A5 to reproduce the original results.

Small samples and EXC comparisons

For the original four numbers, QUARTILE.EXC returns Q1 12.5, median 30, and Q3 70, because its rank is (n + 1) × p. It retains all four input values. Choose the convention specified by your analysis, not a supposed hierarchy of statistical strictness.

Using only A2:A3 (10 and 20), INC returns Q1 12.5, median 15, and Q3 17.5. EXC cannot calculate the two outer quartiles from only two observations. For the one-cell numeric range A2:A2, all five supported INC Types return 10. A range with no numeric observations is an error, not a zero-valued quartile. Integer Types −1 and 5 are invalid.

Verification and availability

This guide covers desktop LibreOffice Calc with English function names and semicolon separators. The official Help, labeled 26.8 when retrieved on 2026-10-23, states that this function has been available since LibreOffice 4.3. Its entry also appears in the 26.8.1.1 source registry. A source entry is not a native test of that release.

The numeric results below were checked independently with exact rational arithmetic, not executed in Calc for this revision. The rank and boundary rules were also checked in the pinned Calc implementation, associated with LibreOfficeDev 26.8.0.0.alpha0. No screenshot, native version test, or cross-application round trip is claimed.

Troubleshooting and sharing

  • Verify the numeric input. =COUNT(A2:A5) should return 4 for the main example. If the count differs, inspect the selected range and imported numeric-looking text. Do not replace missing observations or source errors with zero just to obtain an answer: that changes the dataset.
  • Keep the calculation method explicit. INC and EXC use different ranks. Neither is inherently more rigorous or reserved for academic work. Match the convention required by the report you are reproducing.
  • Do not substitute a rounded rank. Selecting one sorted observation is not linear interpolation. Increasing display precision can reveal a fractional result hidden by cell formatting.
  • Check the intended population. If only certain records should participate, prepare a separate, checked numeric range. Do not assume hiding rows, filtering, or a conditional array expression has removed the intended records.
  • Inspect failures before masking them. Check source error cells and parameters rather than using a blanket IFERROR. This guide does not prescribe untested displayed error codes or text/logical coercion rules.

The Help identifies COM.MICROSOFT.QUARTILE.INC and says it is not part of OpenFormula 1.3. This does not prove support or rejection in any other application. Preserve a working copy and, before sharing another file format, reopen it in the exact receiving application and compare both formula text and the example values. Receiving-application compatibility remains untested here.