So basically I have a column of numbers. I need to calculate the 25th, 50th, 75th, and 90th percentiles automatically. There is one blank row between the bottom of the column and my 25th percentile calculation. The VBA code below would work if the column was a fixed number of rows but there could be anywhere from 10-100+ rows. Does anyone know how to change the code so that it will find the first blank row and the last blank row and include all the data in between within the percentile calc. I know this should be easy for someone with experience modifying and creating code but I haven't been able to work through this on my own. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
<o
></o
>
Thank You, Gabe
<o
></o
>
Sub Percentile()
'
' Percentile Macro
' Percentile Calc
'
'
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-8]C:R[-2]C,0.25)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-9]C:R[-3]C,0.5)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-10]C:R[-4]C,0.75)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-11]C:R[-5]C,0.9)"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub




<o


Thank You, Gabe
<o


Sub Percentile()
'
' Percentile Macro
' Percentile Calc
'
'
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-8]C:R[-2]C,0.25)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-9]C:R[-3]C,0.5)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-10]C:R[-4]C,0.75)"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=PERCENTILE(R[-11]C:R[-5]C,0.9)"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub