My question is: After I define a range in VBA code, how can i use it in formulas such as the percentile formula? I did a search on the forums to find this code:

Dim LastRow As Long

Dim rng As Range

LastRow = Range("A65536").End(xlUp).Row

Set rng = Range("B1:B" & LastRow)

Basically, I paste data in column A, which drive a formula in column B. Column B fills in based on data in column A and fills in 0's for the rest. The above code allowed me to select the non-zero range. Now i want to find the percentile of that range in cell C1. HOw do I do that?

Thank you for any help you can give me.

Dim LastRow As Long

Dim rng As Range

LastRow = Range("A65536").End(xlUp).Row

Set rng = Range("B1:B" & LastRow)

Basically, I paste data in column A, which drive a formula in column B. Column B fills in based on data in column A and fills in 0's for the rest. The above code allowed me to select the non-zero range. Now i want to find the percentile of that range in cell C1. HOw do I do that?

Thank you for any help you can give me.

## Comment