QUARTILE.INC Function (LibreOffice Calc)

Math Intermediate LibreOffice Calc LibreOffice 3.0

The QUARTILE.INC function in LibreOffice Calc returns a specified quartile of a dataset using the inclusive method. This guide explains syntax, examples, quartile logic, errors, and best practices.

The **QUARTILE.INC** function returns a specific quartile (0, 1, 2, 3, or 4) of a dataset using the **inclusive** method. This method allows the minimum and maximum values to be included directly in the quartile calculation.

This guide provides syntax, examples, quartile logic, advanced techniques, common errors, and best practices, making it one of the most complete QUARTILE.INC references available for LibreOffice Calc.

What the QUARTILE.INC Function Does

  • Returns quartiles using the inclusive percentile method
  • Allows quart values 0–4
  • Works with numbers, ranges, and arrays
  • Useful for distribution analysis, box plots, and statistical modeling
  • Supports interpolation
  • Works across sheets

QUARTILE.INC is the standard quartile function in most spreadsheet systems.

Syntax

QUARTILE.INC(range; quart)

Where quart is:

Quart Meaning
0 Minimum value
1 25th percentile (Q1)
2 50th percentile (Median)
3 75th percentile (Q3)
4 Maximum value
QUARTILE.INC is equivalent to:
PERCENTILE.INC(range; quart/4)

Basic Examples

First quartile (Q1)

=QUARTILE.INC(A1:A100; 1)

Median (Q2)

=QUARTILE.INC(A1:A100; 2)

Third quartile (Q3)

=QUARTILE.INC(A1:A100; 3)

Minimum and maximum

=QUARTILE.INC(A1:A100; 0)   → min  
=QUARTILE.INC(A1:A100; 4)   → max

Advanced Examples

Quartile across sheets

=QUARTILE.INC((Sheet1.A1:A100; Sheet2.A1:A100); 3)

Quartile ignoring errors (using AGGREGATE)

=AGGREGATE(17; 2; A1:A100; 3)

Quartile of visible cells only (filtered data)

=AGGREGATE(17; 1; A1:A100; 3)

Conditional quartile (indirect)

=QUARTILE.INC(IF(B1:B100="North"; A1:A100); 1)

(Confirm with Ctrl+Shift+Enter in older Calc versions.)

Quartile excluding zeros

=QUARTILE.INC(IF(A1:A100<>0; A1:A100); 3)

Quartile using sorted helper column

=INDEX(SORT(A1:A100); ROUNDUP(COUNT(A1:A100)*0.75; 0))

Quartile for box‑and‑whisker analysis

=QUARTILE.INC(Data; 1)   → Q1  
=QUARTILE.INC(Data; 2)   → Median  
=QUARTILE.INC(Data; 3)   → Q3

How QUARTILE.INC Calculates Values

QUARTILE.INC uses the inclusive percentile formula:

position = (n - 1) * (quart / 4) + 1

If position is not an integer, interpolation is used.

Example:
Dataset size = 9
Q1 = 0.25
Position = (9 - 1) * 0.25 + 1 = 3

Result = 3rd value in sorted list.

Differences Between QUARTILE.INC and QUARTILE.EXC

Feature QUARTILE.INC QUARTILE.EXC
Quart range 0–4 1–3 only
Includes min/max Yes No
Percentile basis Inclusive Exclusive
Use cases General statistics Academic/strict statistics

Common Errors and Fixes

Err:502 — Invalid argument

Occurs when:

  • quart is outside 0–4
  • Range contains no numeric values
  • Non-numeric text is included

Err:504 — Parameter error

Occurs when:

  • Semicolons are incorrect
  • Range is malformed

Quartile returns unexpected result

Possible causes:

  • Dataset contains zeros
  • Dataset contains errors
  • Hidden rows included

Fix:
Use AGGREGATE for visibility‑aware quartiles.

Quartile differs from QUARTILE.EXC

This is expected—EXC excludes endpoints and uses a different formula.

Best Practices

  • Use QUARTILE.INC for general-purpose quartile calculations
  • Use QUARTILE.EXC for strict statistical analysis
  • Use AGGREGATE for error‑tolerant or visibility‑aware quartiles
  • Use array formulas for conditional quartiles
  • Clean imported data before analysis
  • Use named ranges for cleaner formulas
QUARTILE.INC is ideal for box plots, distribution summaries, and any analysis where inclusive endpoints are appropriate.