You are currently offline, waiting for your internet to reconnect

Algorithm Used for QUARTILE() Function

This article was previously published under Q103493
This article has been archived. It is offered "as is" and will no longer be updated.
In Microsoft Excel, the QUARTILE() function returns a specifiedquartile in an array of numeric values. QUARTILE() accepts 2 arguments:Array and Quart. Array is the range of values for which you want tofind the quartile value. Quart indicates the value you want to return,where:
  0   Minimum value (Same as MIN())  1   1st quartile - 25th percentile  2   2nd quartile - 50th percentile (Same as MEDIAN())  3   3rd quartile - 75th percentile  4   4th quartile - 100th percentile (Same as MAX())
NOTE: In Microsoft Excel versions 5.0 and later, you can use theFunction Wizard to insert the QUARTILE() function, by clicking Function onthe Insert menu. The Function Wizard gives you information about thefunction, as well as required and optional arguments.
Following is the algorithm used to calculate QUARTILE():

  1. Find the kth smallest member in the array of values, where:
    If k is not an integer, truncate it but store the fractional portion (f) for use in step 3.
        quart = value between 0 and 4 depending on which quartile            you want to find.    n     = number of values in the array						
  2. Find the smallest data point in the array of values that is greater than the kth smallest, the (k+1)th smallest member.
  3. Interpolate between the kth smallest and the (k+1)th smallest values:
          Output = a[k]+(f*(a[k+1]-a[k]))      a[k]   = the kth smallest<BR/>      a[k+1] = the k+1th smallest						


To find the 3rd quartile in the array of values, 0,2,3,5,6,8,9, followthese steps:

  1. Find k and f:
          k=TRUNC((3/4*(7-1))+1)=5<BR/>      f=(3/4*(7-1))-TRUNC(3/4*(7-1))=.5						
  2. The 5th (kth) smallest value is 6, and the (5+1)th smallest value is 8.
  3. Interpolate:
"Function Reference," version 4.0, pages 342-343
4.00a 5.00a 5.00c 7.00a 97 98 XL98 XL97 XL7 XL5 XL4 XL

Article ID: 103493 - Last Review: 12/04/2015 09:41:27 - Revision: 1.1

Microsoft Excel 97 Standard Edition, Microsoft Excel 98 for Macintosh

  • kbnosurvey kbarchive KB103493