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
sudhirn@merunetworks.comsudhirn@merunetworks.com 

How to know which quater based on date

Hi, 

  I want to create a two formula fields 

  1. Based on today date which quater 
  2.  There is a custom field which is a date to know which quater the date falling 

 Please suggest me how to create these two formula fields 

Thanks
Sudhir
Best Answer chosen by sudhirn@merunetworks.com
Dario BakDario Bak
Try now please:
 
CASE(MONTH( YOURdateField__c ),
1, "Q1",
2, "Q1",
3, "Q1", 
4, "Q2", 
5, "Q2", 
6, "Q2",
7, "Q3",
8, "Q3",
9, "Q3",
10,"Q4",
11,"Q4",
12,"Q4",
"")

 

All Answers

Dario BakDario Bak
Hi Sudhir, 
   You will need to learn a two formulas.. CASE and MONTH

Create a TEXT formula and add this:
 
CASE(MONTH(dateVariable),
  1,'Q1',
  2,'Q1',
  3,'Q1',
  4,'Q2',
  5,'Q2',
  6,'Q2',
  7,'Q3',
  8,'Q3',
  9,'Q3',
  10,'Q4',
  11,'Q4',
  12,'Q4',
   ''
​)

If this code helps, please mark as best response.

May the force.com be with you...




 
sudhirn@merunetworks.comsudhirn@merunetworks.com
Thanks Dario I tried your code it says syntax error is there any thing missed in the code
Dario BakDario Bak
Try now please:
 
CASE(MONTH( YOURdateField__c ),
1, "Q1",
2, "Q1",
3, "Q1", 
4, "Q2", 
5, "Q2", 
6, "Q2",
7, "Q3",
8, "Q3",
9, "Q3",
10,"Q4",
11,"Q4",
12,"Q4",
"")

 
This was selected as the best answer