Forum Discussion

VW's avatar
VW
Qrew Trainee
3 years ago

Countdown with Conditional Formatting

Hello,

 

I'm trying to show a countdown of business days to an employee's last day and would like to add conditional formatting as follows:

If the countdown is less than 0 days, just show 0

If the countdown is 3-0 days, bold in red font and highlight field yellow

If the countdown is greater or equal to 4 days, no need to do any conditional formatting

 

Can you please assist me with the formula and what field type it should be?

 

I was trying to do a formula along the lines of:

 

If(ToDays([Last day]-today())<=3,"

"<font color=red><b><div style=\"background-color:yellow;\"</div>"&([Last day]-today()),

([Last day]-today())")

 

But I know this won't take into account the 3 different formatting and I was getting error messages related to the field type.

Thank you!

  • Use formula rich text.  You can adjust font size and bolding with this one.

    If(ToDays([Last Day]-Today())<=0,"0",

    If(ToDays([Last Day]-Today())<=3,
    "<span style=\"color:red; font-size:110%; background-color: yellow; font-weight:bold\">" & ToText(ToDays([Last Day]-Today())) & "</span>",

    ToText(ToDays([Last Day]-Today()) )))

    ------------------------------
    Cuong Nguyen
    ------------------------------
    • VW's avatar
      VW
      Qrew Trainee
      Hi.  Thanks, Cuong.  How about having it count business days?  How would I integrate that portion?

      ------------------------------
      V W
      ------------------------------
      • VW's avatar
        VW
        Qrew Trainee
        I think I got it.  I used:

        If((WeekdaySub([Last Day],Today()))<=0,"0",

        If((WeekdaySub([Last Day],Today()))<=3,
        "<span style=\"color:red; font-size:110%; background-color: yellow; font-weight:bold\">" & ToText(WeekdaySub([Last Day],Today())) & "</span>",

        ToText(WeekdaySub([Last Day],Today()) )))

        ------------------------------
        V W
        ------------------------------