Serie of positive numbers

drom

Well-known Member
Joined
Mar 20, 2005
Messages
543
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi and Thanks in Advance

I have 2 columns, Column("A:A") with employes names sorted always in acending order and Column(B:B") with Totals.

I would like to know if some one has a quik macro to get in Column(B:B) how many times the totals where positive in a row.

So if B2:B12= -52, and B13:B15=45, B17=-5, B18=2, then B1:18 answer is 3 I mean we get 3 cells with positive values in a row, "a serie of 3 positive numbers in a row"

if B2:B18=10 then we get 17
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I read your question a little differently.

=MAX(FREQUENCY(IF(B1:B18>0, ROW(B1:B18)), IF(B1:B18<0, ROW(B1:B18))))

The formul MUST be confirmed with Ctrl+Shift+Enter
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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