Hi guys. I have a problem with one of my loops, it takes about 17 seconds to do the job of calculating a simple moving average for 200 periods on 20,000 rows. However, if I do the "FillDown" function for the same type of average, it takes 1 second.
Here is the code for the loop:
![]()
Please Login or Register to view this content.
And here is the other code that does the same job in 1 second:
![]()
Please Login or Register to view this content.
I've used the following to calculate how long each takes:
![]()
Please Login or Register to view this content.
That is where I get the 17 vs 1 second.
Why such a huge difference between the two?
PS. I did notice that if I run another loop right (or a procedure) after the second code (this new loop/procedure uses the 2nd codes moving average numbers from Column "O" obtained by the filldown function) after a few rows, the numbers don't make sense. Why is that? It's like the fill down function is still calculating EVEN after the procedure has ended.
If anyone can shed some light on this, I would really appreciate it!
Bookmarks