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
ChickyChicky 

Half Year Custom Formula Field


I would like to create a field so that I can sort myopportunities by twohalf year categories, ratherthan 4 Quarters:

 

CloseDate from 1/1/2009 to 30/6/2009 = H109

CloseDate from 1/7/2009 to 31/12/2009 = H209

 

Can you help?

Best Answer chosen by Admin (Salesforce Developers) 
JakesterJakester

if( month(CloseDate)<7 ,"H1"+right(text(year(CloseDate)),2) ,"H2"+right(text(year(CloseDate)),2) )

 

All Answers

JakesterJakester

This should be really easy. Untested, but it would be something like:

 

 

if( month(closedate)<7,"H1"+text(right(year(closedate),2)) ,"H2"+text(right(year(closedate),2)) )

 

 

 

ChickyChicky

Thanks so much for trying to help.

 

The error messgae that comes up is:

 

"Error: Incorrect parameter for function right(). Expected Text, received Number"

 

Any suggestions?

JakesterJakester

if( month(closedate)<7,"H1"+right(text(year(closedate),2))

,"H2"+right(text(year(closedate),2))

)

 How bout that?

ChickyChicky

Still not working, sorry; 

 

Error: Incorrect number of parameters for function TEXT(). Expected 1, received 2

 

JakesterJakester

if( month(CloseDate)<7 ,"H1"+right(text(year(CloseDate)),2) ,"H2"+right(text(year(CloseDate)),2) )

 

This was selected as the best answer
ChickyChicky
Thank you so much!
JakesterJakester
You're welcome! Please take a second to mark that last post as the Solution so others can find it easily.