Month Count in Google Sheets.

savvysum

New Member
Joined
Jun 22, 2022
Messages
19
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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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
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,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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