Count Consecutive Cells Containing specific text?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
919
Office Version
  1. 365
  2. 2019
Let's say in F2 to X2, I sometimes have the text DNS. In AN2, How can I count the consecutive instances of DNS?

Thanks
 
Last edited:
Thanks for jumping in, Aladin. Now I'll have to go off & reflect on why that didn't occur to me when I had a look (it being quite late and a few glasses of wine later is some, but not all of the reason!)
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Thank you to both of you. Might I ask for some help on post #19?

Thanks
 
Upvote 0
Care to elaborate on ">/= 15"?

In the image above, I just need to count the highest number of consecutive instances where the value is >/= 15 (so basically the 15, 18, 25 values), so in the first row it would be column F through N, the second row would be F through P, the third row would be N through R, and so on.
 
Upvote 0
In the image above, I just need to count the highest number of consecutive instances where the value is >/= 15 (so basically the 15, 18, 25 values), so in the first row it would be column F through N, the second row would be F through P, the third row would be N through R, and so on.

Control+shift+enter, not just enter:
Rich (BB code):
=MAX(FREQUENCY(IF(ISNUMBER(F2:X2), IF(F2:X2 >= 15, COLUMN(F2:X2))),
  IF(F2:X2 < 15, COLUMN(F2:X2))))
 
Upvote 0
Thanks for jumping in, Aladin. Now I'll have to go off & reflect on why that didn't occur to me when I had a look (it being quite late and a few glasses of wine later is some, but not all of the reason!)

More likely preoccupied mind and wine helping... By the way missed the February events but a study trip with students to Istanbul is underway:)...
 
Upvote 0
"...trip with students to Istanbul is underway."

Very jealous - I'm still stuck in the northeast with no passport :(
 
Upvote 0
Control+shift+enter, not just enter:
Rich (BB code):
=MAX(FREQUENCY(IF(ISNUMBER(F2:X2), IF(F2:X2 >= 15, COLUMN(F2:X2))),
  IF(F2:X2 < 15, COLUMN(F2:X2))))

This doesn't seem to be handling the -'s, DNF's etc. It's giving be a result of 11 for the first row and 13 for the 2nd row. The results should be 9 and 11 respectively.
 
Upvote 0
This doesn't seem to be handling the -'s, DNF's etc. It's giving be a result of 11 for the first row and 13 for the 2nd row. The results should be 9 and 11 respectively.

You seem to overlook your specs: >=15 reads like "only numbers and those which are greater than or equal to 15.

Are you wanting: Not DNS or "-" or any number less than 15?
 
Upvote 0
You seem to overlook your specs: >=15 reads like "only numbers and those which are greater than or equal to 15.

Are you wanting: Not DNS or "-" or any number less than 15?

Right, DNS, DNF, DSQ, - should all be treated the same as 0-14, i.e. not included.
 
Upvote 0

Forum statistics

Threads
1,223,869
Messages
6,175,088
Members
452,611
Latest member
bls2024

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