This macro calculates user-specified percentiles for a data column. You can also use a "By" variable to calculate the percentiles for groups.

Part of this feature exists in Minitab 16. Choose Calc > Calculator and the function percentiles to calculate percentiles of an entire column.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose Tools > Options > General. Under Macro location browse to the location where you save macro files.


If you use an older web browser, when you click the Download button, the file may open in Quicktime, which shares the .mac file extension with Minitab macros. To save the macro, right-click the Download button and choose Save target as.

Required Inputs

  • A column of numeric data. You may also specify a column of grouping values to calculate percentiles for each group level.
  • A column of percentages, or a single constant percent value
  • An empty column to store the results

Running the Macro

Suppose the data are in C1, the percentages are in C2, and you want the percentiles stored in C10. To run the macro, choose Edit > Command Line Editor and type:


Click Submit Commands.


to specify a constant percentage value, just enter this value instead of a column.

Suppose that the data are n C1, the column of percentages is stored in C2, and the By variable (or grouping variable)is in C3. Because the grouping variable has three levels, you need to specify three columns to store the percentiles; say C10, C11, and C12. To run the macro, choose Edit > Command Line Editor and type:

BY C3.

Click Submit Commands.

By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy