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
sfdc dev 2264sfdc dev 2264 

Salesforce formula help needed

Hi,

I need help on the following requirement as follows,

I have 2 fields called "Latest date" and "Latest date 1"

I have a formula which would convert a text to a formula text

for eg : March-2017 would be stored as 01/03/2017

it works fine but my issue issue

if "Latest date" which holds March -2017 values if its null

then the next field "latest period date 1" is having some incorrect format like 1/01 which should also be null

help me how tyo fix it

Thanks in Advance
MY FORMULA :


"01/"+CASE(UPPER(LEFT(Latest_Period_Date__c, FIND("-", Latest_Period_Date__c)-1)),
"JANUARY","01",
"FEBRUARY","02",
"MARCH", "03",
"APRIL", "04",
"MAY", "05",
"JUNE","06",
"JULY","07",
"AUGUST","08",
"SEPTEMBER","09",
"OCTOBER","10",
"NOVEMBER","11",
"DECEMBER","12","0")+"/"+RIGHT(Latest_Period_Date__c,4)

 
Best Answer chosen by sfdc dev 2264
GulshanRajGulshanRaj
Hi,

Please use below formula:
 
IF(ISBLANK(Latest_date__c) ,'',("01/"+CASE(UPPER(LEFT(Latest_date__c, FIND("-", Latest_date__c)-1)),
 "JANUARY","01",
"FEBRUARY","02",
"MARCH", "03",
"APRIL", "04",
"MAY", "05",
"JUNE","06",
"JULY","07",
"AUGUST","08",
"SEPTEMBER","09",
"OCTOBER","10",
"NOVEMBER","11",
"DECEMBER","12","0")+"/"+RIGHT(Latest_date__c,4)))

This will work..

Thanks
Gulshan Raj

All Answers

GulshanRajGulshanRaj
Hi,

Please use below formula:
 
IF(ISBLANK(Latest_date__c) ,'',("01/"+CASE(UPPER(LEFT(Latest_date__c, FIND("-", Latest_date__c)-1)),
 "JANUARY","01",
"FEBRUARY","02",
"MARCH", "03",
"APRIL", "04",
"MAY", "05",
"JUNE","06",
"JULY","07",
"AUGUST","08",
"SEPTEMBER","09",
"OCTOBER","10",
"NOVEMBER","11",
"DECEMBER","12","0")+"/"+RIGHT(Latest_date__c,4)))

This will work..

Thanks
Gulshan Raj
This was selected as the best answer
sfdc dev 2264sfdc dev 2264
Thanks gulshan again