In Google Sheets, sparkline charts is known to have an option to change the last column color.
=sparkline((A1:A5),{"charttype","column";"lastcolor","green"})
What if I want to change last two column colors? Any option like this, or any workaround?
=sparkline((A1:A5),{"charttype","column";"lasttwocolor","green"})
alternative with SPARKLINE and some column width magic:
=INDEX({SPARKLINE(A1:INDEX(A:A, MAX(ROW(A:A)*(A:A<>""))-1),
{"charttype", "column"; "lastcolor", "green"; "ymax", LOOKUP(9^9, A:A)}),
SPARKLINE(OFFSET(A:A, MAX(ROW(A:A)*(A:A<>""))-1, ),
{"charttype", "column"; "color", "green"})})
end result visual:
=INDEX(LAMBDA(a, {SPARKLINE(A1:INDEX(a, MAX(ROW(a)*(a<>""))-1),
{"charttype", "column"; "lastcolor", "green"; "ymax", MAX(a)}),
SPARKLINE(OFFSET(a, MAX(ROW(a)*(a<>""))-1,),
{"charttype", "column"; "color", "green";
"ymax", MAX(a); "ymin", MIN(a)})})(A:A))