Duration Formula with If Statement and Checkbox

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a duration field that I only want to calculate if a checkbox is checked. I have the following formula but it's still calculating a duration even if the condition isn't met:

If(ToText([NTO Resolved in Field])="Yes",Days(0),[Contractor Resolved Date]-[Creation Date])

Can someone help me figure out what I'm doing wrong? 
Photo of Dana

Dana

  • 532 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
Is your checkbox field [NTO Resolved in Field]?

If so, try this:

If([NTO Resolved in Field]=false, null, [Contractor Resolved Date]-[Creation Date])

...
Photo of Dana

Dana

  • 532 Points 500 badge 2x thumb
This did the trick, thank you so so much!
Photo of dwhawe

dwhawe, Champion

  • 662 Points 500 badge 2x thumb
For future reference, use TRUE or FALSE without quotes when testing the value of a checkbox
Photo of Dana

Dana

  • 532 Points 500 badge 2x thumb
I definitely will, thank you!