Carrerpigeon00
New Member
Hello,
I am very new to the word of macros but I think I need one for what I am trying to accomplish here.
I have 4 columns of information:
Column A (an ID column)
Column B (a transaction code)
Column C (the time between the current transaction and the next transaction)
For every time one of three codes (say 100, 150, 175) appears in the Column B, I want to sum Column D until another valid code appears (say 200,250,275) as long as the ID column are the same for all rows.
For instance, lets say you have
ID Code Time Elapse
Row 1 123 103 2
Row 2 123 100 3
Row 3 123 150 3
Row 4 123 170 4
Row 5 123 200 5
Row 6 124 900 6
Row 7 124 150 7
Row 8 124 250 8
Row 9 124 900 10
The sum here would have to start at Row 2 (when one of the 3 starter codes is hit) and stop right before Row 5 (when one of the 3 end codes is hit): 3+3+4 =10 for ID 123 and just 7 for ID 124.
Does anyone have any ideas?
Thanks!
I am very new to the word of macros but I think I need one for what I am trying to accomplish here.
I have 4 columns of information:
Column A (an ID column)
Column B (a transaction code)
Column C (the time between the current transaction and the next transaction)
For every time one of three codes (say 100, 150, 175) appears in the Column B, I want to sum Column D until another valid code appears (say 200,250,275) as long as the ID column are the same for all rows.
For instance, lets say you have
ID Code Time Elapse
Row 1 123 103 2
Row 2 123 100 3
Row 3 123 150 3
Row 4 123 170 4
Row 5 123 200 5
Row 6 124 900 6
Row 7 124 150 7
Row 8 124 250 8
Row 9 124 900 10
The sum here would have to start at Row 2 (when one of the 3 starter codes is hit) and stop right before Row 5 (when one of the 3 end codes is hit): 3+3+4 =10 for ID 123 and just 7 for ID 124.
Does anyone have any ideas?
Thanks!