Count consecutive value

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
How to count the most consecutive "W"s and "L"s in column A, 2 separate cells.
Column A:A will contain only "W"s and "L"s. And the range will continually move down.
There could be more than 1 result, depending on how many games are bet on that day.
Im only giving you a small range, this is the latest range.

Thanks

My Wagers.xlsm
ABCDEFGHIJKLM
260W2/29NBASPRD$ 5.00$ 4.55NOPIND-5.5$4.55R, S, T>0, AL:AM >= 60%
261NBASPRD$ 5.00$ 4.55
262NBASPRD$ 5.00$ 4.55
263NBASPRD$ 5.00$ 4.55
264NBASPRD$ 5.00$ 4.55
265NBASPRD$ 10.00$ 9.10
266$4.55
267$97.31Balance
268W3/1NBASPRD$ 5.00$ 4.76ORLDET-10.5$4.76R, S, T>0, AL:AM >= 60%
269NBASPRD$ 5.00$ 4.55
270NBASPRD$ 5.00$ 4.55
271NBASPRD$ 5.00$ 4.55
272NBASPRD$ 5.00$ 4.55
273NBASPRD$ 10.00$ 9.10
274$4.76
275$102.07Balance
276W3/3NBASPRD$ 10.00$ 9.09HOUSAS-7.5$9.09R, S, T>0, AL:AM>=60%
277NBASPRD$ 5.00$ 4.55
278NBASPRD$ 5.00$ 4.55
279NBASPRD$ 5.00$ 4.55
280NBASPRD$ 5.00$ 4.55
281NBASPRD$ 10.00$ 9.10
282$9.09
283$111.16Balance
284 3/5NBASPRD$ 10.00$ 8.70OKCMIA-8.5($10.00)R, S, T>0, AL:AM>=60%
285 NBASPRD$ 5.00$ 4.55     
286 NBASPRD$ 5.00$ 4.55     
287 NBASPRD$ 5.00$ 4.55     
288 NBASPRD$ 5.00$ 4.55     
289 NBASPRD$ 10.00$ 9.10     
290($10.00)
291$101.16Balance
NBA
Cell Formulas
RangeFormula
H284:H289H284=IFERROR(LOOKUP(2, 1/((COUNTIF($H$283:$H283, [NBA.xlsm]Favs!$I$4:$I$33)=0)*([NBA.xlsm]Favs!$I$4:$I$33<>"")), [NBA.xlsm]Favs!$I$4:$I$33),"")
I284:I289I284=IFERROR(IF(1=MOD(MATCH($H284,[NBA.xlsm]Favs!$A$4:$A$33,0),2),INDEX([NBA.xlsm]Favs!$A$4:$A$33,MATCH(H284,[NBA.xlsm]Favs!$A$4:$A$33,0)+1),INDEX([NBA.xlsm]Favs!$A$4:$A$33,MATCH(H284,[NBA.xlsm]Favs!$A$4:$A$33,0)-1)),"")
J284:J289J284=IFERROR(INDEX([NBA.xlsm]Favs!$B$4:$B$33,MATCH($H284,[NBA.xlsm]Favs!$A$4:$A$33,FALSE)),"")
A284:A289A284=IFERROR(INDEX([NBA.xlsm]Favs!$C$4:$C$33,MATCH($H284,[NBA.xlsm]Favs!$A$4:$A$33,FALSE)),"")
L284:L289L284=IFERROR(INDEX([NBA.xlsm]Favs!$H$4:$H$33,MATCH($H284,[NBA.xlsm]Favs!$A$4:$A$33,FALSE)),"")
K284:K289K284=IF($H284="","",(IF($A284="W",$G284,IF($A284="L",$F284*-1,IF($A284="Psh",0,IF(ISNUMBER(J284),$F284*-1,))))))
K290K290=SUM(K284:K289)
C291C291=IF(AND(LOOKUP(2,1/(Chart!F:F<>""),Chart!F:F)="NBA",INDEX(Chart!F:F,LARGE(IF(Chart!F:F<>"",ROW(Chart!F:F)),2))="NFL"),INDEX(NFL!C:C,LARGE(IF(NFL!C:C<>"",ROW(NFL!C:C)),2))+LOOKUP(2,1/(NBA!K:K<>""),NBA!K:K),$C283+$K290)
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G284:G289Cell Value="W"textNO
G284:G289Cell Value="L"textNO
G276:G281Cell Value="W"textNO
G276:G281Cell Value="L"textNO
G268:G273Cell Value="W"textNO
G268:G273Cell Value="L"textNO
G260:G265Cell Value="W"textNO
G260:G265Cell Value="L"textNO
O359:O360,A307:A1048576,A1:A296Cell Value="W"textNO
K:KCell Value<0textNO
K:KCell Value>0textNO
P5:P11,P13:P19,P21:P27,P29:P35,P37:P43,P45:P51,P53:P59,P61:P67,P69:P75,P77:P83,P85:P91,P93:P99,P101:P107,P109:P115,P117:P123,P125:P131,P133:P139,P141:P147,P149:P155,P157:P163,P165:P171,P173:P179,P181:P187,P189:P195,P197:P203,P205:P211,P213:P219,P221:P227Cell Value<0.525textNO
O359:O360,A307:A1048576,A1:A296Cell Value="L"textNO
O359:O360,A307:A1048576,A1:A296Cell Value="PSH"textNO
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I don't have 2019 to test but maybe this?

Excel Formula:
=MAX(FREQUENCY(IF(A:A<>"", IF(A:A="W", ROW(A:A))), IF(A:A<>"", IF(A:A<>"W", ROW(A:A)))))
 
Upvote 0
I don't have 2019 to test but maybe this?

Excel Formula:
=MAX(FREQUENCY(IF(A:A<>"", IF(A:A="W", ROW(A:A))), IF(A:A<>"", IF(A:A<>"W", ROW(A:A)))))
Perfect, I use it as an Array. Thank you.
 
Upvote 0

Forum statistics

Threads
1,215,088
Messages
6,123,056
Members
449,091
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top