WorksheetFunction.Quartile Method

Returns the quartile of a data set. Quartiles often are used in sales and survey data to divide populations into groups. For example, you can use Quartile to find the top 25 percent of incomes in a population.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Quartile ( _
    Arg1 As Object, _
    Arg2 As Double _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Double
Dim returnValue As Double

returnValue = instance.Quartile(Arg1, _
    Arg2)
double Quartile(
    Object Arg1,
    double Arg2
)

Parameters

  • Arg1
    Type: System.Object

    Array - the array or cell range of numeric values for which you want the quartile value.

  • Arg2
    Type: System.Double

    Quart - indicates which value to return.

Return Value

Type: System.Double

Remarks

Important

This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality. For more information about the new functions, see the Quartile_Inc(Object, Double) and Quartile_Exc(Object, Double) methods.

If quart equals

Quartile returns

0

Minimum value

1

First quartile (25th percentile)

2

Median value (50th percentile)

3

Third quartile (75th percentile)

4

Maximum value

If array is empty, Quartile returns the #NUM! error value.

If quart is not an integer, it is truncated.

If quart < 0 or if quart > 4, Quartile returns the #NUM! error value.

Min(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object), Median(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object), and Max(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) return the same value as Quartile when quart is equal to 0 (zero), 2, and 4, respectively.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace