Participant
September 22, 2023
Answered
Conditional Formatting text
- September 22, 2023
- 2 replies
- 2106 views
Hi,
I have tried a few different bits of code but I can't get this to work, I am trying to get text color to change but not the background colour.
I am after is that if the value of the cell (on page 3 the oxygen saturation) is between 0-86 the text goes red, if its 87-93 it goes magenta, 94-100 its green and any other value its black.
I tried this but it only changes the color to cyan and nothing else
var v = Number(event.value);
v = v.toFixed(2);
if (v<=86){event.target.textColor = color.red;}else if (v>87 && v<=93){event.target.textColor = color.magenta;}else if (v>95 && v<=100){event.target.textColor = color.green;}else{event.target.textColor = color.black;}
Any help would be great.
