A count consecutive formula in Excel

theYaniac

Board Regular
Joined
Jan 7, 2018
Messages
64
Office Version
  1. 365
Platform
  1. Windows
Is there a way to count consecutive cells in excel? I have a sheet with a column "X" for wins and losses. I would like to count the current consecutive win or loss streak. If the column's most recent values are 3 consecutive rows with "W" as a value should be 3. If the next row in X has an L the cell counting wins would be zero and the cell counting the losses would be 1.
1673798654770.png
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Book2
ABCDE
1W/L
2WW3
3WL0
4W
5L
6L
7W
8W
9W
10
Sheet4
Cell Formulas
RangeFormula
D2D2=LEN(TEXTAFTER(TEXTJOIN("",1,Table3[W/L]),"L",-1,1))
D3D3=LEN(TEXTAFTER(TEXTJOIN("",1,Table3[W/L]),"W",-1,1))
 
Upvote 0
Solution
A slight tweak to JGordon11's formula in-case there are only wins or losses, but not both
Excel Formula:
=LEN(TEXTAFTER(CONCAT(A2:A20),"L",-1,1,1))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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