count max loss within visible cells

timpson

New Member
Joined
Aug 31, 2022
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hello
i have list of results (e.g. 123,12,-23,-24,1....) lets say B1:B12
i need to count max consecutive loss number but only for visible cells(if i hide some cell with table filtration it wouldnt be counted)
so far i found =MAX(FREQUENCY(IF(B1:B12<0;ROW(B1:B12));IF(B1:B12>=0;ROW(B1:B12))))
but this one count value even if cell is hidden
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try the following formula...

Excel Formula:
=MAX(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12<0,ROW(B1:B12))),IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12>=0,ROW(B1:B12)))))

To also exclude from the result rows that are manually hidden, replace SUBTOTAL(3,... with SUBTOTAL(103,...

Hope this helps!
 
Upvote 0
Try the following formula...

Excel Formula:
=MAX(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12<0,ROW(B1:B12))),IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12>=0,ROW(B1:B12)))))

To also exclude from the result rows that are manually hidden, replace SUBTOTAL(3,... with SUBTOTAL(103,...

Hope this helps!
Thank you! this is exactly what i need)
 
Upvote 0
Try the following formula...

Excel Formula:
=MAX(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12<0,ROW(B1:B12))),IF(SUBTOTAL(3,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12>=0,ROW(B1:B12)))))

To also exclude from the result rows that are manually hidden, replace SUBTOTAL(3,... with SUBTOTAL(103,...

Hope this helps!
how to make it reversal to count wins?
 
Upvote 0
In that case, try...

Excel Formula:
=MAX(FREQUENCY(IF(ISNUMBER(B1:B12),IF(SUBTOTAL(103,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12<0,ROW(B1:B12)))),IF(ISNUMBER(B1:B12),IF(SUBTOTAL(103,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12>=0,ROW(B1:B12))))))

Hope this helps!
 
Upvote 0
Solution
In that case, try...

Excel Formula:
=MAX(FREQUENCY(IF(ISNUMBER(B1:B12),IF(SUBTOTAL(103,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12<0,ROW(B1:B12)))),IF(ISNUMBER(B1:B12),IF(SUBTOTAL(103,OFFSET(B1:B12,ROW(B1:B12)-ROW(B1),0,1))>0,IF(B1:B12>=0,ROW(B1:B12))))))

Hope this helps!
awesome! Thank you very much)
 
Upvote 0
You're very welcome, glad I could help.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,701
Members
449,117
Latest member
Aaagu

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