Skip to main content
Question

Countdown with Conditional Formatting

  • September 22, 2022
  • 0 replies
  • 122 views

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!

This topic has been closed for replies.

  • Registered
  • September 22, 2022
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
------------------------------