1
votes

enter image description here

I have a sparkline that shows how complete an event is. I would like the color to change based on the value in another cell.

  • If the value is less than 50, I want it to be red;
  • If the value is greater than 51, but less than 75, I want it to be yellow; and - If the value is greater than 76, I want it to be green.

What would be the syntax for that?

I've tried nested if statements, but receive the message that only 3 arguments are allowed.

This is the formula I've tried:

=SPARKLINE((COUNTIF(H4:H14,"yes")/counta(H4:H14)*100),{"charttype","bar";"color1",if(E2<50, "red",if(E2>51, but E2<75, "yellow",if(E2>76, "green")));"max",100}) 
1
I updated my post with the info you asked for.Nicole Hillborn

1 Answers

2
votes
=SPARKLINE((COUNTIF(H4:H14,"yes")/COUNTA(H4:H14)*100),
 {"charttype", "bar";
  "color1",    IF(E2>76, "green", 
               IF(E2>51, "yellow", "red"));
  "max",       100})

0