So this is for a sports-tracking worksheet. There is a column of wins, losses, and ties, denoted by either "W", "L", or "T". I want to find the current streak the team is on, outputted as say "W6" for a 6-game winning streak.
[TABLE="width: 200"]
<tbody>[TR]
[TD]Cell[/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]C5[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C6[/TD]
[TD]T[/TD]
[/TR]
[TR]
[TD]C7[/TD]
[TD]L[/TD]
[/TR]
[TR]
[TD]C8[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C9[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C10[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]Answer[/TD]
[TD]W3[/TD]
[/TR]
</tbody>[/TABLE]
(Example data)
Now there may be empty cells at the bottom of the column (games that have yet to be played). There are spaces for 20 games (cells C5 to C24). I know how to find the most recent game played. I do this by:
Which returns the result of the last game played (in the example, "W").
Then to find out if the cells above are the same result, I can compare them, but I don't know how to keep comparing them. This is what I have:
This compares the cell above the most recent result, and adds 1 to the count if it matches. The problem is to keep doing this, I'd have to nest a bunch of statements to get it to work (in the example, it would only return "W2"). Can anyone help?
[TABLE="width: 200"]
<tbody>[TR]
[TD]Cell[/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]C5[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C6[/TD]
[TD]T[/TD]
[/TR]
[TR]
[TD]C7[/TD]
[TD]L[/TD]
[/TR]
[TR]
[TD]C8[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C9[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]C10[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]Answer[/TD]
[TD]W3[/TD]
[/TR]
</tbody>[/TABLE]
(Example data)
Now there may be empty cells at the bottom of the column (games that have yet to be played). There are spaces for 20 games (cells C5 to C24). I know how to find the most recent game played. I do this by:
Code:
=[COLOR=#000000][FONT=arial]OFFSET([/FONT][/COLOR][COLOR=#109618][FONT=arial]C4[/FONT][/COLOR][COLOR=#000000][FONT=arial],MATCH(2,INDEX(1/([/FONT][/COLOR][COLOR=#DD5511][FONT=arial]C5:C24[/FONT][/COLOR][COLOR=#000000][FONT=arial]<>""),0)),0)[/FONT][/COLOR]
Then to find out if the cells above are the same result, I can compare them, but I don't know how to keep comparing them. This is what I have:
Code:
[COLOR=#000000][FONT=arial]=OFFSET([/FONT][/COLOR][COLOR=#109618][FONT=arial]C4[/FONT][/COLOR][COLOR=#000000][FONT=arial],MATCH(2,INDEX(1/([/FONT][/COLOR][COLOR=#DD5511][FONT=arial]C5:C24[/FONT][/COLOR][COLOR=#000000][FONT=arial]<>""),0)),0)&1+COUNTIF(INDIRECT("C"&4+MATCH(2,INDEX(1/([/FONT][/COLOR][COLOR=#DD5511][FONT=arial]C5:C24[/FONT][/COLOR][COLOR=#000000][FONT=arial]<>""),0))-1),"="&INDIRECT("C"&4+MATCH(2,INDEX(1/([/FONT][/COLOR][COLOR=#DD5511][FONT=arial]C5:C24[/FONT][/COLOR][COLOR=#000000][FONT=arial]<>""),0))))[/FONT][/COLOR]