I wrote out this formula because there was a need for our customers to be able to quickly see if a date was in or out of a current fiscal year. The key component of this formula is to have a way of thinking that doesn’t think of a year as January 1 to December 31st but rather from “First day of Fiscal” to “Last day of Fiscal”.
This formula could be used as a base if your company had a narrow criteria. The particular requirement I had was for plain text results for easier reporting.
CASE(
(if(Month(today())>9,Year(today())+1,Year(today())))-(if(
Month( <<YOURDATEHERE>> )>9,Year(<<YOURDATEHERE>>)+1,Year(<<YOURDATEHERE>>)
)),
1,”Previous FY”,
0,”Current FY”,
“Out of Scope”)
The nice thing with the plain text is that you get a data set that makes reporting SUPER easy because you can then group on that field and have subtotals running.
Enjoy the weekend!
This just saved me after so much frustration. Thank you!!
love it! Thanks for stopping by and letting me know!
This is a great formula! Would you be able to help me with a version that includes Previous 2 FY?
Hi There –
Thanks for dropping by and your comment!
Since this is a case statement, you can drop in a criteria for 2 years back like this:
CASE(
(if(Month(today())>9,Year(today())+1,Year(today())))-
(if(
Month(Sample_Date__c )>9,Year(Sample_Date__c)+1,Year(Sample_Date__c)
)),
2,”Previous Previous”
,1,”Previous FY”,
0,”Current FY”,
“All Else”)
Be sure to test, test, test! Dates can be funky!