Forum Discussion

IrisBonilla's avatar
IrisBonilla
Qrew Cadet
6 years ago

If Else Statement to Input in a Yes/No Field

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!

5 Replies

  • ChrisChris's avatar
    ChrisChris
    Qrew Assistant Captain

    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.


  • 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?
  • 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?
  • No problem. Just make a brand new field and have the formula calculate to either yes or no without all the fancy formatting.