Discussions

Expand all | Collapse all

If Else Statement to Input in a Yes/No Field

  • 1.  If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 19:05
    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!


  • 2.  RE: If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 21:27

    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.




  • 3.  RE: If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 22:07
    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?


  • 4.  RE: If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 22:48
    [Days Past Due]>=Days(140),


  • 5.  RE: If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 22:57
    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?


  • 6.  RE: If Else Statement to Input in a Yes/No Field

    Posted 07-19-2018 23:51
    No problem. Just make a brand new field and have the formula calculate to either yes or no without all the fancy formatting.