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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!