Count of Consecutive Letters in a Row

Classy

New Member
Joined
Oct 14, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am trying to use a formula to count the consecutive letters in a row from an attendance sheet. The letter is "Y" if they have attended and sometimes it is consecutive 2 or 3 times and then further in the table is consecutive 4 or 5 times. I would like the formula to display the higher of the consecutives.

Thanks


1728917046136.png
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi & welcome to MrExcel.
How about like
Excel Formula:
=MAX(FREQUENCY(IF(B2:Z2="Y",COLUMN(B2:Z2)),IF(B2:Z2<>"Y",COLUMN(B2:Z2))))
 
Upvote 0
Solution
Another option:

Excel Formula:
=BYROW(A2:Z3,LAMBDA(x,MAX(SCAN(0,x,LAMBDA(a,v,IF(v="Y",a+1,0))))))
 
Upvote 0
.. and another
Excel Formula:
=MAX(LEN(TEXTSPLIT(CONCAT(--(B2:Z2="Y")),0)))
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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