We help IT Professionals succeed at work.

Calculating value based on last occurence of a particular row!

262 Views
Last Modified: 2018-09-09
Ah hello.

This might be a simple question, but I am a C++ programmer by trade and don't know much about Excel.  So please bear with me :)

I am analysing a network packet trace and have extracted relevant data into the attached spreadsheet.  



Long story short, I need to automatically calculate values in the "A-S" column.  The pseudo-code for doing this is:

while we have not run out of rows
     while value in first column is an S
        remember the value in the VALUE column
        go onto the next row

        (At this point, the value in the first column for the current row is an 'A')
        Subtract the remembered 'S' value from the current row's VALUE
        Write this value into the A-S column for the current row

        Go onto the next row

Open in new window


I haven't got a clue how to do this.  Can someone please advise?
Comment
Watch Question

Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you very much!
Subodh Tiwari (Neeraj)Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015

Commented:
You're welcome!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.