Invalid Value Error with New Year
Hello! I have created a formula for 4 months after a specified date column. The problem is, when that 4 months goes into next year, I receive the "#INVALID VALUE" error. For example, if my formula is using the date of 08/31/19, I receive the proper formulated response of 12/31/19...but if I change the date to 09/01/19, I receive the Invalid Value error (that should give the formulated response of 01/01/20 but changing years is when I receive the error).
Anybody know how to fix this? This is my formula:
=DATE(YEAR([ECM Implementation]34), MONTH([ECM Implementation]34) + 4, DAY([ECM Implementation]34))
Comments
-
The problem is that you are not adding four months to a date, you are adding four to the month number. Therefore an error is thrown after month 8 because of course there isn't a month number of 13, 14, 15, or 16.
To account for this we will use an IFERROR statement. This along with a slight tweak to your above formula will basically say that if there is an issue with the date when you add four to the month number, then we want to instead add one to the year and subtract eight from the month number.
The basic breakdown...
=IFERROR(DATE(year, month + 4, day), DATE(year + 1, month - 8, day))
If there is an error with the PRIMARY formula, then run the SECONDARY formula.
=IFERROR(DATE(YEAR([ECM Implementation]34), MONTH([ECM Implementation]34) + 4, DAY([ECM Implementation]34)), DATE(YEAR([ECM Implementation]34) + 1, MONTH([ECM Implementation]34) - 8, DAY([ECM Implementation]34)))
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 380 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 305 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!