Good afternoon everyone!
I'm not a coder by any means, and I'm actually learning formulas and coding through the Salesforce Developer sandbox. So my question probably is an easy one.
I am trying to create a custom formula based on what a user picks in a pulldown menu. Depending on the length of a contract, and the start date of the contract, the output would be the expiration of said contract.
My question is, how can I make a formula where one of the pulldown options does not return a date, but returns text instead? When I try to output anything besides a date, Salesforce returns an error that it was not in a date format (since I picked date as the Formula Return Type)
IF (ISPICKVAL( Duration__c , "Indefinite"), "TEXT HERE" ,
IF (ISPICKVAL( Duration__c , "6 Months"), Date_Executed__c + 183,
IF (ISPICKVAL( Duration__c , "1 Year"), Date_Executed__c + 365,
IF (ISPICKVAL( Duration__c , "2 Years"), Date_Executed__c + 730,
IF (ISPICKVAL( Duration__c , "3 Years"), Date_Executed__c + 1095,
IF (ISPICKVAL( Duration__c , "5 Years"), Date_Executed__c + 1825, Date_Executed__c
)
)
)
)
)
)
Thanks everyone!