Help

Re: Help with a formula not recognizing when field is blank

Solved
Jump to Solution
1837 0
cancel
Showing results for 
Search instead for 
Did you mean: 
bmcad1116
4 - Data Explorer
4 - Data Explorer

Can someone help me figure out why the ‘else’ part of my IF statement isn’t working?

I'm trying to create a friendly date/time/timezone field IF a certain date field is not blank. That part is working. But if the date field is blank, I want it to put “N/A” in the new field. That part is returning an error.

Here is my formula.

IF(

 {REQUESTED GO LIVE DATE} !=BLANK(),

  DATETIME_FORMAT({REQUESTED GO LIVE DATE}, 'M/D/YY') & " at " & {REQUESTED GO LIVE TIME} & " " & {GO LIVE TIME ZONE}, "N/A"

)

I also tried it this way:

IF(

  {REQUESTED GO LIVE DATE} !=BLANK(),

  DATETIME_FORMAT({REQUESTED GO LIVE DATE}, 'M/D/YY') & " at " & {REQUESTED GO LIVE TIME} & " " & {GO LIVE TIME ZONE},

IF({REQUESTED GO LIVE DATE}=BLANK(),"N/A"

))

But neither formula is recognizing what to do if the REQUESTED GO LIVE DATE field is blank. Oddly, it is working when I remove the first part of the formula to only look for blank date field. 

IF({REQUESTED GO LIVE DATE} = BLANK(),"N/A"

)

Attached is a screenshot of the results.

1 Solution

Accepted Solutions
Alexey_Gusev
13 - Mars
13 - Mars

Hi, 
In short, you don't need to use BLANK() word, Just IF({Field}, [expression when Field not empty] , [output when Field is blank] ). The last can be omitted, default is blank, so IF ({Field} , [expression] ) also works.

See Solution in Thread

2 Replies 2

Hey @bmcad1116

Try this formula:

TRIM(
    IF(
        {REQUESTED GO LIVE DATE},
        DATETIME_FORMAT(
            {REQUESTED GO LIVE DATE},
            'M/D/YY'
        )
        & IF(
            {REQUESTED GO LIVE TIME},
            ' at '
        )
    )
    &
    IF(
        AND(
            {REQUESTED GO LIVE DATE},
            {REQUESTED GO LIVE TIME}
        ),
        {REQUESTED GO LIVE TIME} & IF(
            {GO LIVE TIME ZONE},
            ' ' & {GO LIVE TIME ZONE}
        )
    )
)
Alexey_Gusev
13 - Mars
13 - Mars

Hi, 
In short, you don't need to use BLANK() word, Just IF({Field}, [expression when Field not empty] , [output when Field is blank] ). The last can be omitted, default is blank, so IF ({Field} , [expression] ) also works.