[SalesForce] How to write a formula using a picklist and a date field

I have a picklist field for "Interview Applicable" with the choices being "Yes" or "No". I also have a date field for "Scheduled Interview". I have a third field that is a text field. I'm trying to write a formula for the text field that will give me "NA" if Interview Applicable is "No" and the Scheduled Interview date if Interview Applicable is "Yes". I keep tweaking the formula but continue getting a syntax error message. Below is one version of the formula I've tried. Any help is greatly appreciated!

IF(ISPICKVAL(Interview_Applicable_c, "No"), "NA",
IF(ISPICKVAL(Interview_Applicable_c, "Yes"), "Scheduled_Interview_c"))

Best Answer

First thing, which may have just been accidental when writing your question is that those custom fields should have two underscores in their name _ _ c.

Second, this should work for you.

IF(ISPICKVAL(Interview_Applicable__c, "Yes"), 
    TEXT(MONTH(Scheduled_Interview__c)) + "/" +
    TEXT(DAY(Scheduled_Interview__c)) + "/" +
    TEXT(YEAR(Scheduled_Interview__c)), "NA")

If the picklist value is 'yes' it converts the date field value into text and if it is 'no' any other value, you receive 'NA' as the result of the formula.

NA


Date
This formula is of the type Text

Formula Definition

Related Topic