Search code examples
google-sheetssparklines

google sheets sparkline column type byrow with Ymin & Ymax columns byrow too


Recently I found a method really useful to have an "arrayformula" for the sparkline function. As you can see in the sparkline byrow file in the I2 cell there is the only formula but I'm not able to find a good method to use dynamically min and max value. Pratically I would like substitute the fix value "ymin"\0;"ymax"\400 with the values calculated in columns G and H row by row.

Any suggestions?


Solution

  • The formulas used to calculate the min and the max are MIN(row) and MAX(row)*1,2 respectively. So you can use that instead of 0 and 400 in your BYROW formula.

    =BYROW(A2:F21;LAMBDA(row;SPARKLINE(row;{"charttype"\"column";"color"\"green";"ymin"\MIN(row);"ymax"\MAX(row)*1,2})))