Count consecutive runs of numbers in a row.

Daymo66

New Member
Joined
May 5, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all,
Sorry for such a newb question....
Long time lurker first time poster.

I have a row that contains either C,L,F or a blank cell.
I would like to count the maximum number of letters that appear in a sequence before a blank cell.
e.g.
FCCCFL_FF_LLLCFFFL_ = 8

Appreciate this is very simple, but Id really be most grateful for the help.
KR
D
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(data,A2:A100,s,SEQUENCE(ROWS(data)),MAX(FREQUENCY(IF(data<>"",s),IF(data="",s))))
 
Upvote 0
Thanks for this Fluff.
Ive popped it in and changed A2:A100 to the desired rows (U6:BD6) and its giving me 36, the answer I've counted manually is 7

That's the highest number of of cells in a row containing a C, F or L before there is an empty cell.

What should I adjust.

Really appreciated.
KR
D
 
Upvote 0
Missed it was for a row, so it should be
Excel Formula:
=LET(data,U6:BD6,s,SEQUENCE(,COLUMNS(data)),MAX(FREQUENCY(IF(data<>"",s),IF(data="",s))))
 
Upvote 0
Missed it was for a row, so it should be
Excel Formula:
=LET(data,U6:BD6,s,SEQUENCE(,COLUMNS(data)),MAX(FREQUENCY(IF(data<>"",s),IF(data="",s))))
Excellent, thanks for this. Its still giving me a total of 36, Ive obv missed something, do I need to put C, L, or F in the (data="",s)?
Thanks for your patience.
D
 
Upvote 0
Here is another formula that will work...
Excel Formula:
=MAX(LEN(TEXTSPLIT(TRIM(CONCAT(IF(U6:BD6=""," ",U6:BD6)))," ")))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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