How to count consecutive occurances of values greater than 0?
I'm a fundraiser for a charity. I have an excel sheet containing our individual donors' giving totals for each year--going back 15 years. Of course, few of our donors have donated every year. If the a donor did not give in a certain year, their giving total for that year is shown as 0.
I am in desperate need of a formula that will count the consecutive years a donor has given $1 or more to our organization, counting backwards from the year 2011.
If the donor gave every year for the past fifteen years, the formula will return 15.
If the donor gave only one gift, and the gift was in 2011, the formula will return 1.
If the donor did not give in 2011, the formula will return 0.
If the donor gave in 2011 and 2010, but not 2009, the formula will return 2.
If the donor gave in 14 of the last 15 years, but didn't give in 2008, the formula will return 3.
Re: How to count consecutive occurances of values greater than 0?
Thanks for your reply.
The "Countif" function is part of the solution, but in addition to counting if value is greater than zero, I need the count to begin with the left-most cell, then count to the right each cell with a value greater than zero, until it hits a cell with 0, then stop counting.