Offset data in Repeating group

Hi, I’m getting data from an API endpoint but want to do an offset calculation in each of the cells in a repeating group using the same variable.

I have a variable for the offset, for example offset = 2 for the data should look like this:

7 | 0
12 | 0
20 | 7
23 | 12
30 | 20

I then want to subtract the second number from the first so the result would be: 7, 12, 13, 10. I want to display this result in the same repeating group cell along side the original number so for instance for the 3rd set of values 20,13

Thanks!
Paul