+ Reply to Thread
Results 1 to 5 of 5

Double SUMIF

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    Paraparaumu, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    2

    Double SUMIF

    I have a spreadsheet which has multiple columns. I have SUMIF'ed some of the columns but now I wish to sum depending upon criteria in two separate columns, e.g.

    I have the following data
    Letter Direction Amount
    A In 1
    A In 1
    A Out 2
    B Out 2
    B In 1
    B In 3
    A Out 4
    C In 2
    C In 1

    I have SUMIF'ed for A, B and C and also SUMIF'ed for In and Out but now I want to SUM the Amount for Letter and Direction, i.e. I want the SUM of Amount for A and In, A and Out, B and In, B and Out, etc.

    How do i say basically say If Letter=A and Direction =In then sum the Amount?

    Thanks
    John

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Double SUMIF

    Pre XL2007 you are looking at SUMPRODUCT, ie:

    =SUMPRODUCT(--(A1:A100="A"),--(B1:B100="Out"),C1:C100)

    Note with SUMPRODUCT (pre XL2007) you can not use entire column range references (A:A) nor should you - keep ranges to a min. so as to minimise impact on performance.

    You might want to think about using a Pivot Table.

    For more info. on both SUMPRODUCT (incl. use of double unary (--)) and Pivot Tables see appropriate links in my sig.
    Last edited by DonkeyOte; 07-06-2009 at 04:27 AM. Reason: added detail re: use of column references (specific to SUMPRODUCT)

  3. #3
    Registered User
    Join Date
    07-06-2009
    Location
    Paraparaumu, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Double SUMIF

    Excellent. It does exactly what i want - now if only I understood why

    Thanks
    John

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Double SUMIF

    Have a read through of Bob Phillips' white paper on the SUMPRODUCT function - link is in my sig.

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Double SUMIF

    Pivot tables will get you the best results.

    If you have just one request Letter=A Direction=Out then Advanced Filter would be an alternative for SUMPRODUCT
    Attached Images Attached Images
    Last edited by rwgrietveld; 07-08-2009 at 04:22 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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