If Else Statement to Input in a Yes/No Field

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
Hello!

I am currently working on a field that ask whether or not a project is +140 days over its due date. I have the field "Over +140?" as a Formula - Rich Text. There is another field I am basing it on, "Days Past Due" which gives the actual number of days past due date. 

I'm hoping to make a if/else statement that will check if the field "Days Past Due" is or over 140, then the field "Over +140" should be populated with the response of "Yes". Otherwise it should be "No". 

I need this field in order to have it as a filter for my table that will show me all the projects that are 140 and more days past due.

Thank you!
Photo of Iris Bonilla

Iris Bonilla

  • 320 Points 250 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

If(

[Days Past Due]>=140,

"<div style='color:red'>Yes</div>","<div style='color:green'>No</div>"

)


the comma separating the two html elements is like "else".

If days past due is equal to or greater than 140, then, Yes in red, else, No in green.


(Edited)
Photo of Iris Bonilla

Iris Bonilla

  • 320 Points 250 badge 2x thumb
Thank you! However, I forgot to mention that this is a [Days Past Due] is a formula duration field, so it gives me an error that the operator ">=" cannot be use with these types of expressions.

Any help?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
[Days Past Due]>=Days(140),
Photo of Iris Bonilla

Iris Bonilla

  • 320 Points 250 badge 2x thumb
Thank you! I'm almost done I swear. 

No that it works and I have put it as a filter, when I go to the filter itself and it only gives me the option of "<div style='color:green'>No</div>" or "<div style='color:red'>Yes</div>" instead of Yes or No. Any tips?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
No problem. Just make a brand new field and have the formula calculate to either yes or no without all the fancy formatting.