+ Reply to Thread
Results 1 to 4 of 4

Based on previous and successive values, create rolling sum

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Based on previous and successive values, create rolling sum

    This is difficult to explain: 5 columns
    Col1---Col2---Col3---Col4---Col5
    1----1--- 10---Type1 --- $1.75
    2----2--- 20---Type9 --- $1.75
    3----2--- 30---Type11-- $1.75
    4----2--- 50---Type16-- $1.75
    5----3--- 90---Type2--- $1.75
    6----3--- 100--Type3--- $1.75
    7----4--- 90--- Type2--- $1.75
    8----1--- 20--- Type4 --- $1.75

    (no hyphens, just used to separate columns - newbie over here)
    What I'm trying to do is combine the values of the instance of 3 as a sum, then the instance of 2 as sum and the two combined as the sum of 1. (IE) 4=$1.75, 3=$3.50, 2=$5.25 and 1 = $10.50. NOTE - the values are vastly different from one line to the next, $1.75 was used as an example only for easier math.

    Now, underneath line #8 there is a new value of 1 so all the successive rows would need to have a sum similar to lines 1 through 6. The order is represented by Col1, the value by Col5, the line item break down by columns 2 and 3, Col 4 is simply the type/name if you will.

    I'm at a loss on how to do this programmatically. A bit beyond my expertise. I am able to format this, pull it from a text file hopefully get the sums with the help of you kind people, then move it into an MS Access backend for storage.

    Any help, or direction would be greatly appreciated. Thank you.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Based on previous and successive values, create rolling sum

    Not sure that I understand what you want, but if I and correct, then try this...
    =SUMIF($D$2:$D$9,D2,$E$2:$E$9)
    copied down

    If the is not what you wanted, i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, what your expected outcome is, and how you arrived at that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Based on previous and successive values, create rolling sum

    Costing.xls

    See attached, I added information that might better explain what I'm trying to do.

  4. #4
    Registered User
    Join Date
    04-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Based on previous and successive values, create rolling sum

    No ideas anyone?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1