Help with formula
Can someone look at this formula, its working for VSS but not for CPIC. It just stopped working couple of months ago
=IF([Type of PRC:]@row = "VSS", DATE(YEAR([PRC issue date]@row) + 3, MONTH([PRC issue date]@row), DAY([PRC issue date]@row)), IF([Type of PRC:]@row = "CPIC", DATE(YEAR([Start Date]@row), MONTH([Start Date]@row) + 4, DAY([Start Date]@row))))
Error says Invalid value
Best Answer
-
thanks so much, made a little change to the highlighted part and then it worked
=IF([Type of PRC:]@row = "VSS", DATE(YEAR([PRC issue date]@row) + 3, MONTH([PRC issue date]@row), DAY([PRC issue date]@row)), IF([Type of PRC:]@row = "CPIC", IF(MONTH([Start Date]@row) < 9, DATE(YEAR([Start Date]@row), MONTH([Start Date]@row) + 4, DAY([Start Date]@row)), DATE(YEAR([Start Date]@row) + 1, MONTH([Start Date]@row) - 8, DAY([Start Date]@row)))))
Answers
-
I would guess it is because when you add 4 to the month in the start date it errors out if that results in > 12. You will need to add logic to handle the rollover for the year. Something like this should work:
=IF([Type of PRC:]@row = "VSS", DATE(YEAR([PRC issue date]@row) + 3, MONTH([PRC issue date]@row), DAY([PRC issue date]@row)), IF([Type of PRC:]@row = "CPIC", IF(MONTH([Start Date]@row) < 9, DATE(YEAR([Start Date]@row), MONTH([Start Date]@row) + 4, DAY([Start Date]@row)), DATE(YEAR([Start Date]@row + 1), MONTH([Start Date]@row) - 8, DAY([Start Date]@row))))
-
thanks so much, made a little change to the highlighted part and then it worked
=IF([Type of PRC:]@row = "VSS", DATE(YEAR([PRC issue date]@row) + 3, MONTH([PRC issue date]@row), DAY([PRC issue date]@row)), IF([Type of PRC:]@row = "CPIC", IF(MONTH([Start Date]@row) < 9, DATE(YEAR([Start Date]@row), MONTH([Start Date]@row) + 4, DAY([Start Date]@row)), DATE(YEAR([Start Date]@row) + 1, MONTH([Start Date]@row) - 8, DAY([Start Date]@row)))))
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
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!