Loop Sum Question

Hi all, does anyone know how I can use a function to sum the number of years a formula has been positive? for example cash going up over 5 years. If cash went up 5 years ago 1 point is added. If cash then went up again 4 years ago 1 is added for a total of two. If years 3, 2 and 1 cash growth is negative or flat no extra points are added for a total of 2 points. Currently I use boolean for things like this and I end up with hundreds of formulas. Thanks

1 Like

This would count the number of times in the last 5 years (using annuals) that Cash was greater than the prior year:
LoopSum("Cash(CTR,ANN) > Cash(CTR+1,ANN)",5)

1 Like

Thanks danp, much appreciated. This will help make my formulas a lot more elegant

Take a look at the new one too, LoopStreak. It counts streaks as the name implies.

1 Like

Yes, definitely want to try that one as well. Thank you Marco.