Lets say I have data like so...

A     B     C     D     E
50   100   125   175   225

I want to create a sparkline that will show the difference between each column


But, I don't want to make my spreadsheet have 2x the number of rows in order to calculate the intermediate result.

Is there a function that will take a range of cells and return an array after apply some math on the input range?

Compute Data on range of data

Edit: Solution proposed worked perfectly... Here's what it looks like when applied.

enter image description here

1 Answer 1


Use arrayformula to perform operations on arrays, for example

=sparkline(arrayformula(B2:E2 - A2:D2))

plots the sparkline of differences B2-A2,..., E2-D2.

  • Odd, how the arrayformula is inside the sparkline.
    – Jacob Jan
    Jun 19, 2016 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.