Text Field showing different values depending on the calculation

  • 0
  • 1
  • Question
  • Updated 2 weeks ago
  • Answered
I want a field to show value of "LT1" if it is less than 1 day late than the expected start of the program and other values depending on how many days it is late, I have this formula but it doesn't show the values when I test it

If(
not IsNull([Started]),"NA",([Active Dif Calc]>1),"LT1",([Active Dif Calc]>7),"LT7")
Photo of Katrina E

Katrina E

  • 240 Points 100 badge 2x thumb

Posted 2 weeks ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 59,768 Points 50k badge 2x thumb
The IF conditions are evaluated in the sequence in your formula. So for starters you need to test for the larger values first and then work your way down to the smaller values.

If(
not IsNull([Started]),"NA",
[Active Dif Calc]>7,"LT7",
[Active Dif Calc]>1,"LT1")

Note that is not necessary to clutter up your formula with extra brackets. It just makes it harder to read.

I do not know what type of field

[Active Dif Calc]

So I don’t know for sure if that formula will work.
Photo of Katrina E

Katrina E

  • 240 Points 100 badge 2x thumb
It worked! I have another thing to add to this though.  I'm trying to add a formula to this existing formula that will yield a value of "E1", if the start date which is a date/time field is less than one day away.  I tried to use ">" but it's not allowed for date time field.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 59,768 Points 50k badge 2x thumb
Maybe this is what you want

If(
not IsNull([Started]),"NA",
[Active Dif Calc]>7,"LT7",
[Active Dif Calc]>1,"LT1",
Now()-[Start Date] < Hours(24), "E1")