Search code examples
excelexcel-formulaworksheet-functionpercentile

Compute PERCENTILE in MS Excel when some values are error values


Computing 90% percentile of integers in range say A1:A10 can be done by the formula =PERCENTILE(A1:A10, 0.9). This works well generally but if one or more cells in the range A1:A10 is an error (marked as #N/A), then the percentile value computed is also #N/A.

Is it possible, using only Excel formulas, to compute percentile for all values (except the cells containing error values) in range A1:A10?


Solution

  • In Excel 2010 or later versions you can use AGGREGATE function for this, AGGREGATE has an option to ignore error values, so you can use this formula

    =AGGREGATE(16,6,A1:A10,0.9)

    See help for AGGREGATE function for more details but 16 denotes the function type - in this case PERCENTILE.INC (the equivalent of PERCENTILE in earlier versions) and 6 means "ignore errors"