Calculating Month from Date Column
Hello,
I am looking for help with the formula below. I am referencing another sheet and trying to calculate the number of rows that fall within January in the 'Milestone Due Date' column. The dates in the 'Milestone Due Date' column displayed in the following format: mm/dd/yy.
=COUNTIFS({Project}, [Primary Column]@row, {Milestone Due Date}, =MONTH(1))
Appreciate any help anyone can provide.
Thanks!
Andrea
Comments
-
Brian,
In regards to your note, the reason may be because there are blank cells in your column. Try wrapping the MONTH statement in an IFERROR statement. Something along the lines of...
IFERROR(MONTH(@cell) = 1, 0)
What this will do is if there is an error within any cell the MONTH function is looking at (to include blanks), it will replace that with 0. Because 0 is a number, it will negate the error of a blank cell (or non-date value) and allow your formula to continue working. The other nice thing is that there is no month 0, so you don't have to worry about it inadvertently being included in other calculations.
-
Thanks Brian. This worked like a charm!
-
Thanks Paul. This is a great workaround.
-
Happy to help. I learned this one the hard way... Haha
-
Brian & Paul -
Is there also a way to exclude anything that is not in 2019 in this same formula?
Thanks!
Andrea
-
Fantastic! Thank you for your help, Paul!
-
No worries. Happy to help!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!