COUNTIF Date Next Month
So, I'm trying to create a sheet summary formula that will count the number of milestones in my project schedule that is due next month.
Because I have a section in my project schedule for milestones that is linked to various tasks throughout the project schedule I'm able to use the CHILDREN() function to limit the range. The formula I've been trying to use is:
=COUNTIF(CHILDREN([End Date]3), IF(ISDATE(@cell), AND(IF(MONTH(TODAY()) = 12, 1, MONTH(TODAY()) + 1), YEAR(@cell) = IF(MONTH(TODAY()) = 12, YEAR(TODAY()) + 1, YEAR(TODAY())))))
However, I keep getting an #INVALID DATA TYPE error and I cant figure out why. The formulas I'm using to calculate milestones for last month and the current month work just fine. It's just the milestone for next month that I can't seem to get. I'm sure it's something simple that I'm overlooking, but for the life of me I just can't see it.
Any help at all would be greatly appreciated.
Best Answer
-
Looks like your formula has some syntax errors, but is also a bit too complicated. Try this:
=COUNTIF(CHILDREN([End Date]3), MONTH(@cell) = IF(MONTH(TODAY()) = 12, 1, MONTH(TODAY()) + 1))
Hope that helps.
Cheers,
Ramzi
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
Answers
-
Looks like your formula has some syntax errors, but is also a bit too complicated. Try this:
=COUNTIF(CHILDREN([End Date]3), MONTH(@cell) = IF(MONTH(TODAY()) = 12, 1, MONTH(TODAY()) + 1))
Hope that helps.
Cheers,
Ramzi
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
-
That worked! Thank you very much!!
-
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!