Month Count in Google Sheets.

savvysum

New Member
Joined
Jun 22, 2022
Messages
17
Office Version
  1. 365
Platform
  1. MacOS
Hi,
I'm looking for an excel formula that can count the months from the start of positive #s to the end of positive #s.
Zero values in between positive #s count.
Zero values do not count before the first positive # or after the last positive #.

Client5/31/20224/30/20223/31/20222/28/20221/31/202212/31/202111/30/202110/31/2021Formula Answer
A0121404
B21001005
C061000027

I appreciate your time.
 
Last edited by a moderator:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How about
Excel Formula:
=LET(f,FILTER(COLUMN($B$1:$I$1),B2:I2<>0),MAX(f)-MIN(f)+1)
 
Upvote 0
Are you sure you are using 365 as LET has been around for quite a while.
 
Upvote 0
I'm using google sheets. How do I translate for google sheets?
 
Upvote 0
That is something that you make very clear right from the start, Excel & Sheets are NOT the same thing.
Also questions regarding sheets should be posted in the General Discussion & Other Applications section of the board.
I have done that for you this time.
 
Upvote 0
How about
Excel Formula:
=MAX(FILTER(COLUMN($B$1:$I$1),B2:I2<>0))-MIN(FILTER(COLUMN($B$1:$I$1),B2:I2<>0))+1
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,684
Members
449,116
Latest member
HypnoFant

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