Skip to main content

Test for empty, but not empty if zero

  • November 12, 2018
  • 2 replies
  • 33 views

Forum|alt.badge.img+6

Hi! I have a duration field that is sometimes filled out and sometimes not. I’d like to test to see if it’s empty. The problem is that for the meaning of the field, zero is different from empty. Currently if I do something like:

IF( Duration )
or
If ( Duration = BLANK() )

it returns false for both the field being empty or it being zero. Is there a way to tell the difference in a formula?

2 replies

Forum|alt.badge.img+5
  • Inspiring
  • November 13, 2018

Actually, there is: Rather than test {Duration}, test {Duration}&'' — like so:

IF(
    {Duration}&''='',
    'Duration field is empty',
    IF(
        {Duration}&''='0',
        'Duration field contains 0:00',
        'Duration field has non-zero value'
        )
    )

Forum|alt.badge.img+6
  • Author
  • New Participant
  • November 13, 2018

Ah, that works, thank you!