...
Compute the rank (R) of a Pth percentile. This is done using the following formula:
R = P/100 x (N + 1)
where P is the desired percentile and N is the number of input fields.Compute the percentile:
If R is an integer, the Pth percentile will be the number with rank R.
If R is not an integer, the Pth percentile is computed by interpolation as follows:
If the interpolation method is Nearest Neighbour, the following equation is used:
Pth = V[int(R + 0.5)]If the interpolation method is Linear, the following steps are used:
Define IR as the integer portion of R
Define FR as the fractional portion or R
Find the scores with Rank IR and with Rank IR + 1, e.g. V[IR] and v[IR+1]
Interpolate Interpolate by multiplying the difference between the scores by FR and add the result to the lower score, e.g.
Pth = FR * (v[IR+1] - V[IR]) + V[IR]