Calculation Quarters
Using this formula I get FY2023 Q4 (example) but if the End Date field is empty I get unparseable. How can I fix this?
="FY" + YEAR([End Date]@row) + " Q" + IF(MONTH([End Date]@row) = 1, "4", IF(MONTH([End Date]@row) = 2, "4", IF(MONTH([End Date]@row) = 3, "4", IF(MONTH([End Date]@row) = 4, "1", IF(MONTH([End Date]@row) = 5, "1 ", IF(MONTH([End Date]@row) = 6, "1 ", IF(MONTH([End Date]@row) = 7, "2", IF(MONTH([End Date]@row) = 8, "2", IF(MONTH([End Date]@row) = 9, "2", IF(MONTH([End Date]@row) >= 10, "3 ", " "))))))))))
Best Answer
-
Either of these formulas will work. The first checks to see if the End Date is a date before continuing with the formula (if there is no end date, the results are empty) and the second just places a blank value if the formula can't work due to a lack of an end date.
=IF(ISDATE([End Date]@row), "FY" + YEAR([End Date]@row) + " Q" + IF(MONTH([End Date]@row) = 1, "4", IF(MONTH([End Date]@row) = 2, "4", IF(MONTH([End Date]@row) = 3, "4", IF(MONTH([End Date]@row) = 4, "1", IF(MONTH([End Date]@row) = 5, "1 ", IF(MONTH([End Date]@row) = 6, "1 ", IF(MONTH([End Date]@row) = 7, "2", IF(MONTH([End Date]@row) = 8, "2", IF(MONTH([End Date]@row) = 9, "2", IF(MONTH([End Date]@row) >= 10, "3 ", " ")))))))))))
=IFERROR("FY" + YEAR([End Date]@row) + " Q" + IF(MONTH([End Date]@row) = 1, "4", IF(MONTH([End Date]@row) = 2, "4", IF(MONTH([End Date]@row) = 3, "4", IF(MONTH([End Date]@row) = 4, "1", IF(MONTH([End Date]@row) = 5, "1 ", IF(MONTH([End Date]@row) = 6, "1 ", IF(MONTH([End Date]@row) = 7, "2", IF(MONTH([End Date]@row) = 8, "2", IF(MONTH([End Date]@row) = 9, "2", IF(MONTH([End Date]@row) >= 10, "3 ", " ")))))))))), "")
Hope this helps!
Answers
-
Either of these formulas will work. The first checks to see if the End Date is a date before continuing with the formula (if there is no end date, the results are empty) and the second just places a blank value if the formula can't work due to a lack of an end date.
=IF(ISDATE([End Date]@row), "FY" + YEAR([End Date]@row) + " Q" + IF(MONTH([End Date]@row) = 1, "4", IF(MONTH([End Date]@row) = 2, "4", IF(MONTH([End Date]@row) = 3, "4", IF(MONTH([End Date]@row) = 4, "1", IF(MONTH([End Date]@row) = 5, "1 ", IF(MONTH([End Date]@row) = 6, "1 ", IF(MONTH([End Date]@row) = 7, "2", IF(MONTH([End Date]@row) = 8, "2", IF(MONTH([End Date]@row) = 9, "2", IF(MONTH([End Date]@row) >= 10, "3 ", " ")))))))))))
=IFERROR("FY" + YEAR([End Date]@row) + " Q" + IF(MONTH([End Date]@row) = 1, "4", IF(MONTH([End Date]@row) = 2, "4", IF(MONTH([End Date]@row) = 3, "4", IF(MONTH([End Date]@row) = 4, "1", IF(MONTH([End Date]@row) = 5, "1 ", IF(MONTH([End Date]@row) = 6, "1 ", IF(MONTH([End Date]@row) = 7, "2", IF(MONTH([End Date]@row) = 8, "2", IF(MONTH([End Date]@row) = 9, "2", IF(MONTH([End Date]@row) >= 10, "3 ", " ")))))))))), "")
Hope this helps!
-
Thank you! That did the trick.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!