Returns the quartile of a data set. QUARTILE divides data into four equal parts. Quart values: 0=minimum, 1=1st quartile (25th percentile), 2=median (50th percentile), 3=3rd quartile (75th percentile), 4=maximum. QUARTILE uses inclusive method (same as QUARTILE.INC). Essential for quartile analysis, box plots, IQR calculation, outlier detection, and statistical analysis.
Master the fundamentals of Excel QUARTILE function
The QUARTILE function returns the quartile of a data set. QUARTILE divides data into four equal parts (quartiles). The quart parameter specifies which quartile: 0=minimum, 1=1st quartile (25th percentile/Q1), 2=median (50th percentile), 3=3rd quartile (75th percentile/Q3), 4=maximum. QUARTILE uses the inclusive method and is equivalent to QUARTILE.INC. It can return the minimum (quart=0) and maximum (quart=4) values. Essential for quartile analysis, box plots, IQR (Interquartile Range) calculation (Q3-Q1), outlier detection, data distribution analysis, and statistical analysis.
Quart parameter 0 to 4
Uses inclusive method
Divides into four parts
Provides box plot values
Function-specific parameters
Function-specific return type
Find quartile values
Create box plots
Calculate Interquartile Range
Identify outliers
Exact matching required
Returns numeric position
Handles missing text gracefully
=QUARTILE(array, quart)Array or range of data values.
Quartile value: 0=minimum, 1=1st quartile (25th percentile), 2=median (50th percentile), 3=3rd quartile (75th percentile), 4=maximum.
The quartile value
Description: Returns the quartile of a data set
Get minimum value
QUARTILE(range, 0) returns the minimum value. Same as MIN(range).
Use QUARTILE function in VBA
' Basic QUARTILE in VBA
Range("C1").Value = Application.WorksheetFunction.Quartile(Range("A1:A10"), 2)
' Returns: Median (50th percentile)
' Calculate all quartiles
Sub CalculateAllQuartiles()
Dim minValue As Double
Dim q1Value As Double
Dim medianValue As Double
Dim q3Value As Double
Dim maxValue As Double
minValue = Application.WorksheetFunction.Quartile(Range("A1:A10"), 0)
q1Value = Application.WorksheetFunction.Quartile(Range("A1:A10"), 1)
medianValue = Application.WorksheetFunction.Quartile(Range("A1:A10"), 2)
q3Value = Application.WorksheetFunction.Quartile(Range("A1:A10"), 3)
maxValue = Application.WorksheetFunction.Quartile(Range("A1:A10"), 4)
Range("B1").Value = "Min: " & minValue
Range("B2").Value = "Q1: " & q1Value
Range("B3").Value = "Median: " & medianValue
Range("B4").Value = "Q3: " & q3Value
Range("B5").Value = "Max: " & maxValue
End Sub
' Compare QUARTILE with QUARTILE.INC
Sub CompareQuartileINC()
Dim quartileValue As Double
Dim quartileINCValue As Double
Dim quart As Integer
quart = 1 ' 1st quartile
quartileValue = Application.WorksheetFunction.Quartile(Range("A1:A10"), quart)
quartileINCValue = Application.WorksheetFunction.Quartile_Inc(Range("A1:A10"), quart)
Range("B1").Value = "QUARTILE: " & quartileValue
Range("B2").Value = "QUARTILE.INC: " & quartileINCValue
' Should be equal
End Sub
' Calculate IQR (Interquartile Range)
Sub CalculateIQR()
Dim q1 As Double
Dim q3 As Double
Dim iqr As Double
q1 = Application.WorksheetFunction.Quartile(Range("A1:A10"), 1)
q3 = Application.WorksheetFunction.Quartile(Range("A1:A10"), 3)
iqr = q3 - q1
Range("B1").Value = "Q1: " & q1
Range("B2").Value = "Q3: " & q3
Range("B3").Value = "IQR: " & iqr
End Sub
' Find outlier boundaries
Sub FindOutlierBoundaries()
Dim q1 As Double
Dim q3 As Double
Dim iqr As Double
Dim lowerBound As Double
Dim upperBound As Double
q1 = Application.WorksheetFunction.Quartile(Range("A1:A10"), 1)
q3 = Application.WorksheetFunction.Quartile(Range("A1:A10"), 3)
iqr = q3 - q1
lowerBound = q1 - 1.5 * iqr
upperBound = q3 + 1.5 * iqr
Range("B1").Value = "Lower bound: " & lowerBound
Range("B2").Value = "Upper bound: " & upperBound
End SubFind quartile values
Create box plots
Calculate Interquartile Range
Identify outliers
QUARTILE returns #NUM!
quart must be 0, 1, 2, 3, or 4Solution: quart must be 0, 1, 2, 3, or 4. If quart is outside this range or not an integer, QUARTILE returns #NUM!. Use only values 0-4.
Getting unexpected value
0=min, 1=Q1, 2=median, 3=Q3, 4=maxSolution: Check quart value. 0=min, 1=Q1 (25th percentile), 2=median (50th percentile), 3=Q3 (75th percentile), 4=max. Remember these values.
Uncertainty about difference
QUARTILE = QUARTILE.INC (identical functions)Solution: QUARTILE and QUARTILE.INC are equivalent - they have identical behavior. Both use inclusive method. Use either one.
Uncertainty about difference
QUARTILE includes endpoints, QUARTILE.EXC excludesSolution: QUARTILE uses inclusive method - can return min (quart=0) and max (quart=4). QUARTILE.EXC uses exclusive method - cannot return exact min/max for quartiles 1-3. QUARTILE includes endpoints, QUARTILE.EXC excludes.