Skip to main content

It should be simple, but I am having trouble getting the formula correct for an IF statement. What I need to happen is:

If the Admit Date is null and the Stage is 50-Admit,

Then set Admit Date to Today's date.

9 answers
  1. Apr 1, 2020, 10:13 PM

    I haven't checked if this compiles yet but:

     

    IF(

    AND(

    ISBLANK(Admin_Date__c),

    ISPICKVAL(StageName, "50-Admit")

    ), TODAY(), ''

    )

     

    I like to think of pieces of formulas as boxes and based on what you put in, you get something different back out.

    In this case we have an IF box and an AND box inside of it.

     

    IF boxes check if what you are putting into its either TRUE or FALSE . When TRUE, it gives you the next argument back, if FALSE it give you the last argument back. "IF(this is true, gimme this, otherwise this)"

    In this case our IF contains an AND box. AND will return either TRUE or FALSE. We are putting two questions in our AND box here:

    -- Is the Admin Date Blank

    AND

    -- is my StageName "50-Admit"

    So, "AND(is this true, is this true too?)"

     

    IF both of those are TRUE, show me Today's date. Otherwise (in my example, show me nothing).

     

    HOWEVER, If you're using this as a FORMULA FIELD, this will return the current date all the time and I am guessing that is not what you want. Meaning today that value would read 4/1/2020 but tomorrow it would read 4/2/2020.

     

    I think what it sounds like you my be looking for is workflow rule formula like Steve suggests. So when a record is created/update (depending on your needs) that workflow rule runs and updates your target field with today's date. If in fact you are talking about a workflow formula, Steve nailed it (as per usual).

     

    Pardon me if I'm jumping in here where I'm not welcome.

0/9000