jeudi 26 septembre 2019

Use nested IF statements to change sparkline colors

Im trying to colorcode my sparklines based on percentage cutoffs.

I am able to do two colors but can't wrap my head around multiple ifs.

B1 has points possible of 3

B2 has points scored first time

B3 has points scored second time

B4 has a two column sparkline.

•B1 can vary from 2 to 8.

•Would like to color code the sparklines where each column has its own colors based on the following percentage conditions of Cell B1

-•>0% but <50% to be (RED)

-•>=50% but <75% to be (ORANGE)

-•>=75% but <100% to be (GREEN)

-•>100% to be (BLUE) I used the following formula to create two possible ones where the high color is blue or green.

=if(B3>B1, SPARKLINE(B2:B3,{"charttype","column";"color","red";"highcolor","blue";"ymin",0}), SPARKLINE(B2:B3,{"charttype","column";"color","red";"highcolor","green";"ymin",0}))

https://docs.google.com/spreadsheets/d/1cvzznbrsR0GdqEr6J52_aWOSFDAf0zYn9MxglzKRyfA/edit?usp=sharing

Aucun commentaire:

Enregistrer un commentaire