Looking for the longest run of zeros in a column

Marvo

Board Regular
Joined
Nov 27, 2023
Messages
155
Office Version
  1. 2021
Platform
  1. Windows
Hi All, newbie here. I was perusing your excellent site looking for an answer to a problem I have. I have two columns (K & L) with over 5000 rows with data. I'm interested in finding the longest string of zeros. (then afterwards adding extra criteria (Column E with either "H" or "A" in it & Column I with "League") I'm stumped at the minute even without adding the criteria. However I came across this thread on here


and I think its very similar to what I need, though its a column, not a row and I'm only interested in zeros.

Many thanks.
 

Attachments

  • Mr Excel.JPG
    Mr Excel.JPG
    88.1 KB · Views: 5

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Sorry, should have said I have been searching for the answer to this elsewhere.

 
Upvote 0
Perhaps:

Excel Formula:
=MAX(FREQUENCY(IF(ALL!$L$2:$L$9999&""="0",ROW(ALL!$L$2:$L$9999)),IF(ALL!$L$2:$L$9999<>0,ROW(ALL!$L$2:$L$9999))))

?

Also, I think you can avoid the INDIRECT problems by amending your other summary formulas to something like:

Excel Formula:
=MAX(FREQUENCY(IF((ALL!$E$2:$E$9999="H")*(ALL!K2:K9999<>0),ROW(ALL!K2:K9999)),IF((ALL!$E$2:$E$9999="H")*(ALL!K2:K9999=0),ROW(ALL!K2:K9999))))

for Home for example.
 
Upvote 0
Solution
Thank You.

It returned, "A value in the formula is of the wrong data type"
 
Upvote 0
Opps. My mistake, it worked. I forgot it needed Control, shirt, enter.

Can I now add criteria to that?
 
Upvote 0
Wow. That's fantastic, you've been a great help.
 
Upvote 0
Glad we could help, and a belated welcome to the forum! :)
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,138
Members
449,098
Latest member
Doanvanhieu

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