Need a Formula to Show if Current Month & Year (in a checkbox)
=IFERROR(IF(AND(MONTH(TODAY) - MONTH(Date@row) = 0, (YEAR(TODAY) - YEAR(Date@row) = 0)), 1, 0))
Hi
I want to check the "Current Month & Year" column from the Date column if true, so I can roll reports and data for next year.
Not sure if my attempt is close or not!!
Thanks in advance.
Best Answer
-
Perfect
Thanks Kelly
Answers
-
Hey @Steve Dearing
Yes, only a small tweak is needed. Your TODAY function needs to be written as TODAY(). Also, the IFERROR function is wrapped completely around another function or formula. First write your formula, parentheses and all, then wrap the IFERROR around it. You must designate what happens in the event of error.
Your formula logic will work perfectly. I'll offer another approach
=IFERROR(IF(AND(MONTH(Date@row)=MONTH(TODAY()), YEAR(Date@row)=YEAR(TODAY()), 1),"")
Will this work for you?
Kelly
-
Hi Kelly
used your approach and came back with "incorrect argument set"
=IFERROR(IF(AND(MONTH(Date@row) = MONTH(TODAY()), YEAR(Date@row) = YEAR(TODAY()), 1), ""))
Steve
-
grrr. my bad. I rushed and didn't close the AND clause.
=IFERROR(IF(AND(MONTH(Date@row) = MONTH(TODAY()), YEAR(Date@row) = YEAR(TODAY())), 1), "")
-
Perfect
Thanks Kelly
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.4K Get Help
- 364 Global Discussions
- 202 Industry Talk
- 430 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 284 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!