+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    03-16-2010
    Location
    Chesterfield, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Running total based on previous If statement

    Hiya all.

    I’m an average user of Excel, but I now require a complex formula. I have got lots of number crunching to do soon and am trying to be ahead of the game by setting up a working template. I'm finding it quite hard to explain so please bare with me...

    What I need a formula to do is firstly find the Male people (indicated by M or F in a Gender column), then move along the row and find a score. Then repeat the process adding the new score to the previously found one. This needs to continue until all the males have been found.

    I also need to do this for female but I imagine it will be the same process.

    I have attached a simple example of what I want to do. I would really appreciate any help with this, even if it’s "Its not possible" just so I don’t waste any time trying to guess how to do it

    Thanks in advance.
    ste d
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    843

    Re: Running total based on previous If statement

    Based on your sheet's set up, you are looking for a grand total, not a running total.
    For the Males in B10
    Code:
    =SUMPRODUCT(--(C2:C4="M"),(D2:D4))
    I've updated your attachment with a running total in the E and F columns.
    Attached Files Attached Files
    Last edited by mdbct; 03-16-2010 at 12:43 PM.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    4,972

    Re: Running total based on previous If statement

    To count, use COUNTIF
    =COUNTIF($C$2:$C$4,"M")
    To Sum, use SUMIF
    =SUMIF($C$2:$C$4,"M",$D$2:$D$4)

    Does that work for you?
    ChemistB
    My 2¢

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  4. #4
    Registered User
    Join Date
    03-16-2010
    Location
    Chesterfield, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Running total based on previous If statement

    Both brilliant answers. Thanks a lot guys, I've got it working a treat now. You're both legends.

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.2.0