# VBA Code Needed for a certain formula in Excel?

I have an excel sheet, and I am trying to bring some sort of automation in to that sheet (since I use it quite often) with the help of macros. The fact is that I am really new to macros and VBA programming language, so I need a little help in writing the code to find the 10th percentile (the formula for it is PERCENTILE(array, 0.1) for each bin value (50, 100, 150).

If you see the picture attached, the wanted percentile values are in Q, the bins for which I want to find the 10th percentile value, are given in Column M (50,100,150) and the main data on which the 10 percentile value will be based is given in Column D.

By Using the data given in D and filtering out a certain bin width in column E (Example: Filtering bin width 50 or 100), we could find the Percentile value against each of the bin value given in Column N.

As said earlier I am new to VBA code, so any help will be appreciated in order to find the percentile values for each bin.

the link to the original spread sheet is given below:

http://bit.ly/XCgqtK

## Discussions

7 years ago

Asking a question twice is generally frowned upon.

Was there something wrong with the answers from the previous question?

https://www.instructables.com/answers/VBA-Code-for-finding-the-10th-percentile-value-for/

Answer 7 years ago

+10%