I want to count how many years a company has increased the profit from now. So if the previous year had lower profits than this year it counts as 1 and goes one year back in past to count until there is one years profit higher than the year after that. So it must be a ongoing trend from this year (2017) so that it counts the years.
(Years of increases should be 5 not 4, sorry!)
In the picture it has to count until 2011 because there was a year(2012) without increasing profits relative to last year(2011).
So maybe its even possible with a Excel Function. Otherwise VBA is probably the way to do this.
EDIT: Is it possible to count years of steady profits, too? Like if 2015 = 5 and 2016 = 5 then this should not stop streak.
See Question&Answers more detail:os