Hello everyone,
I have a little problem with a macro somebody here might be able to help me with. Unfortunately the upload function doesn't seem to work for me so I'll have to describe the sheet. It looks something like this (I hope it's understandable, column C is empty here):
A B C
1 68
1 72
1 85
1 91
1 102
2 40
2 54
2 60
2 68
3 76
3 86
3 94
So in column A I have the number of the corresponding 'block' of data, which is ascending by one (it's around 400 in the original file, I just put 1-3 here for this example). In column B I have corresponding data which is always rising from one cell to the next, until the next block starts (e.g 1 -> 2). The length of these blocks varies.
Now in column C, what I would like to do is calculate a list of the differences of those numbers in column B in regards to the FIRST entry of that block (which would itself be changed to "0"). So in this example the outcome should look something like this:
A B C
1 68 0
1 72 4
1 85 17
1 91 23
1 102 34
2 40 0
2 54 14
2 60 20
2 68 etc.
3 76
3 86
3 94
I hope you guys can understand what I mean I'm really new to VBA and I'm having trouble figuring this out, especially how I should program the macro so that it starts from zero again once the block changes (when the number in column A increases by one).
Any help would be greatly appreciated! Thank you.
Bookmarks