+ Reply to Thread
Results 1 to 6 of 6

Sum if number in column is the same, do another sum if it is different

Hybrid View

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    2

    Cool Sum if number in column is the same, do another sum if it is different

    I have the following datafile were B are participants (participant n.2 and participant n.4) and F is the number of behaviours. From this datafile I need to derive another datafile where each row is one participant (so in this case I would have a row for n.2 and a row for .4 and F would be the sum of the behaviours (so in this case it would be 0 and 7) OF EACH PARTICIPANT

    FROM THIS -->

    B F

    2 0
    2 0
    4 5
    4 1
    4 1

    -->TO THIS

    2 0
    4 7

    How do I do this in the most economic way possible (I have hundreds of rows and 80 participants and I don't want to do the sum for each participant separately...)?

    --> How do I sum the numbers in column F "in groups" according to the number on column B (if it is the same, then sum it, if not then create another row and another sum)??


    Your help would be greatly appreciated!!!
    Thank you

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sum if number in column is the same, do another sum if it is different

    use sumif
    =sumif(b1:b100,2,f1:f100)
    =sumif( b1:b100,4,f1:f1000
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,065

    Re: Sum if number in column is the same, do another sum if it is different

    most economi...

    Insert Pivot table:
    Attached Files Attached Files
    Never use Merged Cells in Excel

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sum if number in column is the same, do another sum if it is different

    Welcome to the forum.

    Are you looking for the SUMIF() function maybe?

    http://www.excelfunctions.net/ExcelSumif.html

  5. #5
    Registered User
    Join Date
    05-23-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Sum if number in column is the same, do another sum if it is different

    The numbers on B are not just 2 and 4, they change, so how can I use the sum if function?

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Sum if number in column is the same, do another sum if it is different

    I would advise zbor's solution, use Pivot Tables

+ 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