Count Longest Streak

mrjnice85

New Member
Joined
May 12, 2015
Messages
9
Hey everyone,

I have an excel file that I would like to capture the longest streak of cells that contain a number greater than 0. I currently have an array formula in cell J14:

{=MAX(FREQUENCY(IF(L14:AM14<>$BI$83,COLUMN(L14:AM14)), IF(L14:AM14=$BI$83,COLUMN(L14:AM14))))} ($BI$83 is just an empty cell)

The problem I run into is that all the cells in that range of L14:AM14 are formulas. So my array can't use >0 or =0. The problem with that existing array is it includes cells which the value of the formula is "x" or "ooc". I'm not overly confident with array's and I pieced that formula together through luck of searching around but haven't found out how to omit the "x" and "occ". Any help would be greatly appreciated. Here is an example of the table below:

AJKLMNOPQRST
3UsernameLongest Streak944943942941940939938937936
4------------------------------------
14Eliboyi4OOCx1232412452097088000
21Gibsy5155361199612404935293600925612468

<tbody>
</tbody>

As you can see for J14 it returns a streak of 4 when it should only be 2 since we don't want to include the OOC's or X
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try...

=MAX(FREQUENCY(IF(ISNUMBER(L14:AM14),IF(L14:AM14>0,COLUMN(L14:AM14))),IF((1-ISNUMBER(L14:AM14))+(L14:AM14=0),COLUMN(L14:AM14))))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

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