Skip to main content
Solved

Color Coding based on field value

  • August 8, 2024
  • 0 replies
  • 335 views

EmberKrumwied
Forum|alt.badge.img+13

Struggling with the correct formula syntax to evaluate the value in a field for color coding. I have a % field that can calculate to either a positive or negative number. I have a separate field that I am using to display a color depending on that % value. I'd like for the color field to show as green if the % is between 15% and -15%, if the % is outside this range (above 15% or below -15%) to show as red.

This is the formula I've created thus far (using responses from other discussions), but nothing is displayed.

If([Land % Change]>0.15,"<span style='background-color:red;'></span>",
If([Land % Change]<-0.15,"<span style='background-color:red;'></span>","<span style='background-color:green;'></span>"))

I even tried reversing the "<" and ">" but still nothing shows up.  

Best answer by DougHenning1

I believe that's due to an empty span and the inline display. Try this:

<span style='background-color:red;display:block;'>&nbsp;</span>

 

Forum|alt.badge.img+6
  • Quickbase Staff
  • Answer
  • August 8, 2024

I believe that's due to an empty span and the inline display. Try this:

<span style='background-color:red;display:block;'>&nbsp;</span>