I'm writing a vba function to generate moving averages for smoothing a graph. I need to use quartile ranges to adjust the smoothing formula. How do I pass the QuartileRange to the Evaluate function to return the quartile value of that range so I may use it in my function?
The function is called as follows
=MovingAverageSmoothQuartile( A1, 4, B1:b10 )
Where
A1is the value to smooth,4is the number of values to use andB1:B10is a column of samples used to calculate the quartile value.Function MovingAverageSmoothQuartile(r As Range, ByVal m As Integer, QuartileRange As Range) ' returns a smoothed average using the 'rectangular' method Dim q1 As Double, q2 As Double, q3 As Double q1 = Evaluate("Quartile( " + QuartileRange.Text + ", 1") ' <--- Stuck here
QuartileRange.Textcontain?