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

`SPARKLINE( [B-A, C-B, D-C, E-D])`

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?

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

## Best Answer

Use

`arrayformula`

to perform operations on arrays, for exampleplots the sparkline of differences B2-A2,..., E2-D2.