+ Reply to Thread
Results 1 to 9 of 9

Help! I need to create a running total that can will reset itself.

  1. #1
    Registered User
    Join Date
    03-20-2015
    Location
    Canada
    MS-Off Ver
    OSX
    Posts
    4

    Angry Help! I need to create a running total that can will reset itself.

    I have a set of 2000 random numbers in on, all between 0 and 1. I have also set up a second column where these random numbers are assigned a pass or fail value, 0 or 1 (0-0.75 = 0, 0.75-1 = 1) When these numbers are randomly generated i need a running sum until the value changes.

    Example

    Pass/fail......running sum
    0.............. 1
    0...............2
    0.............. 3
    0...............4
    1...............1
    1...............2
    0...............1
    0...............2
    1 ..............1
    0...............1
    0...............2
    0...............3

    I understand the logistics behind what needs to be done, I just am having trouble finding the proper function in excel!
    Last edited by hackshow51; 03-20-2015 at 05:56 PM. Reason: clarity

  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
    52,930

    Re: Help! I need to create a running total that can will reset itself.

    Try this...
    A
    B
    2
    0
    1
    3
    0
    2
    4
    0
    3
    5
    0
    4
    6
    1
    1
    7
    1
    2
    8
    0
    1
    9
    0
    2
    10
    1
    1
    11
    0
    1
    12
    0
    2
    13
    0
    3

    B2=IF(A2=A1,B1+1,1)
    copied down
    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
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: Help! I need to create a running total that can will reset itself.

    Not fully understanding the question. You want a running some of all 0s and another running sum of all 1s based on the value 1,2,3,4 etc.?

    Assuming your table is set up the way you posted it, the formula is

    sum of 0s
    =SUMIF(A1:A12,0,B1:B12)

    sum of 1s
    =SUMIF(A1:A12,1,B1:B12)

    Thanks,
    Newb

  4. #4
    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
    52,930

    Re: Help! I need to create a running total that can will reset itself.

    Newbie, you could be right there. I took it that the OP wanted the count to reset every time the value in A changed.

    Guess we will have to wait and see
    Thats the good thing about forums, different people read the exact same thing, different ways

  5. #5
    Registered User
    Join Date
    03-20-2015
    Location
    Canada
    MS-Off Ver
    OSX
    Posts
    4

    Re: Help! I need to create a running total that can will reset itself.

    Thanks for the help guys, however I'm still having some issues. I do want the count to reset every time the Value in A changes, it should reset to 1, not 0. Any recommendations for a next step?

  6. #6
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Help! I need to create a running total that can will reset itself.

    Then FDibbins should have nailed it. You just have to manually enter B1.

  7. #7
    Registered User
    Join Date
    03-20-2015
    Location
    Canada
    MS-Off Ver
    OSX
    Posts
    4

    Re: Help! I need to create a running total that can will reset itself.

    Yes, now it is fixed, thanks for all the help!

  8. #8
    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
    52,930

    Re: Help! I need to create a running total that can will reset itself.

    Happy to help, thanks fo rthe feedback

  9. #9
    Registered User
    Join Date
    03-20-2015
    Location
    Canada
    MS-Off Ver
    OSX
    Posts
    4

    Re: Help! I need to create a running total that can will reset itself.

    One further question, if I then want to sum the end points of each reset, and calculate an average of these values, how would i do this?

    Example

    0.....1
    0.....2
    0.....3
    1.....1
    1.....2
    0.....1
    0.....2
    1.....1
    1.....2
    1.....3
    0.....1

    In this case i would need the function to sum (3+2+2+3+1) in order to get an average of the end points


    ***I really appreciate the help, this is supposed to be an introductory course but my professor is rather lacking in his explanations, and i don't find these to be the most straightforward questions***

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need a formula for running total to reset at zero
    By jconnelley in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-05-2014, 03:18 PM
  2. Replies: 1
    Last Post: 05-09-2012, 04:32 PM
  3. Running total reset by zero
    By flyp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2011, 06:49 PM
  4. How do i create a running total in Excel?
    By Marcus1 in forum Excel General
    Replies: 2
    Last Post: 08-24-2005, 08:05 AM
  5. IF/THEN Statements to Create a Running Total
    By x9navysteve in forum Excel General
    Replies: 0
    Last Post: 03-16-2005, 11:46 AM

Tags for this Thread

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