Hi,
I am calculating probability density function for a set of data which is arranged over 55 rows in a column. The equation is working if I refer the absolute row positions in the formula, however it is not working if I try making it dynamic, by defining a last row. The data is from row 2 to 56. The mean and standard deviation values are placed at row number 58 and 59, so to calculate the probability function I need to refer the row number 58 and 59 in the formula. The trouble is I have to modify the formula everytime the number of data changes, sometimes 100 rows of data or sometimes 20 rows of data.
How can I make it dynamic? Can you tell me a way to modify the NORMDIST formula to integrate the last row function? Anyone?
Here is the code:
It'd help me alot! Thanks in advance.![]()
LastRow = Cells(Rows.Count, "A").End(xlUp).Row NextRw = LastRow + 1 Cells(2, "B").Select ActiveCell.Formula = "=NORMDIST(RC[-1], R58C[-1], R59C[-1], False)" ActiveCell.Select Selection.AutoFill Destination:=Range("B2:B" & NextRw), Type:=xlFillDefault
Sanjeev
Bookmarks