Can I define a local value (or variable) in a Google Spreadsheet formula? -


sometimes come long spreadsheet formulas, such 1 create "data bars" using unicode characters (addresses relative g3):

= rept("█"; floor(10 * f3 / max(f$1:f$999)))   & mid(" ▏▎▍▌▋▊▉█";          1 + round(8 * (        10 * f3 / max(f$1:f$999)                        - floor(10 * f3 / max(f$1:f$999))));          1) 

data bars

it nice have kind of let() define local variables:

= let('x', 10 * f3 / max(f$1:f$999),        rept("█"; floor(x))       & mid(" ▏▎▍▌▋▊▉█"; 1 + round(8 * (x - floor(x))); 1)) 

does such thing exist?

if not, there clever hacks achieve same result inside formula? (without using cell)


edit: not example, because sparkline() function kind of bar chart (thanks harold!) question still stands: how clean complex formulas , avoid repetition, apart using additional spreadsheet cells?

can spreadsheet formula "sparkline" solution you?

=sparkline(10,{"charttype","bar";"max",20}) 

Comments