DavidSCowan
Board Regular
- Joined
- Jun 7, 2009
- Messages
- 78
I need to count backwards the runs of occurances of consectutive Ys (yes's) which are interupted by Ns.
So for example we have:
<tbody>
</tbody>
The end of a run of Ys comes when the next cell is an 'N'. e.g. the run of 4 Ys starting in month 25 comes to an end with the N in monthl 21.
Using Offset and Match I know how to do this going forwards but I can't do it going backwards!
Can anyone help please (I am using Excel 2007)
So for example we have:
Months: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Ys &Ns | Y | Y | Y | Y | Y | Y | N | Y | N | N | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | Y | Y | Y | Y |
Backward runs of Ys | 1 | 2 | 3 | 4 | 5 | 6 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 | 4 |
<tbody>
</tbody>
The end of a run of Ys comes when the next cell is an 'N'. e.g. the run of 4 Ys starting in month 25 comes to an end with the N in monthl 21.
Using Offset and Match I know how to do this going forwards but I can't do it going backwards!
Can anyone help please (I am using Excel 2007)