function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
carmykecarmyke 

Need help with creating a formula that will auto-populate Revenue Quarter and Booking Quarter

I have created a custom field called Booking Quarter (Booking Qtr) and I want to auto populate this field with a specific fiscal quarter.  For example, when my sales team enters Close Date of 6/15/2010, I want the Booking Qtr field to auto-populate with Q2 2010.  Any advice on how to do this?  Our fiscal quarters align with calendar quarters (i.e. CY Q1 = FY Q1).

 

Thank you.

Best Answer chosen by Admin (Salesforce Developers) 
kingkong94538kingkong94538

Hey Carmyke,

 

Here is a formula that you can use. (Assuming your close date field is custom - otherwise replace it with the actual field name). You need to put this formula under your Booking Quarter field. Let me know if you have any questions.

 

CASE(
MONTH(Close_Date__c),
1, "CY Q1" + "-" + TEXT(YEAR(Close_Date__c)),
2, "CY Q1"+ "-" + TEXT(YEAR(Close_Date__c)),
3, "CY Q1"+ "-" + TEXT(YEAR(Close_Date__c)),
4, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
5, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
6, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
7, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
8, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
9, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
10, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
11, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
12, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
"Error")

 

 

Thanks!

All Answers

kingkong94538kingkong94538

Hey Carmyke,

 

Here is a formula that you can use. (Assuming your close date field is custom - otherwise replace it with the actual field name). You need to put this formula under your Booking Quarter field. Let me know if you have any questions.

 

CASE(
MONTH(Close_Date__c),
1, "CY Q1" + "-" + TEXT(YEAR(Close_Date__c)),
2, "CY Q1"+ "-" + TEXT(YEAR(Close_Date__c)),
3, "CY Q1"+ "-" + TEXT(YEAR(Close_Date__c)),
4, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
5, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
6, "CY Q2"+ "-" + TEXT(YEAR(Close_Date__c)),
7, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
8, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
9, "CY Q3"+ "-" + TEXT(YEAR(Close_Date__c)),
10, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
11, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
12, "CY Q4"+ "-" + TEXT(YEAR(Close_Date__c)),
"Error")

 

 

Thanks!

This was selected as the best answer
carmykecarmyke

King Kong!!  You are AWESOME!!  Exactly what I needed.  Worked perfectly.

 

Sincere thanks,

Sean