+ Reply to Thread
Results 1 to 5 of 5

SumIF multiple column criteria

  1. #1
    Registered User
    Join Date
    03-05-2008
    Posts
    6

    SumIF multiple column criteria

    Hi, looking to work a sum function with multiple match criteria. I.e., if column A = x and Column B = y, then sum Column C
    Last edited by VBA Noob; 03-05-2008 at 05:09 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =SUMPRODUCT((A1:A10="X")*(B1:B10="Y")*(C1:C10))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-05-2008
    Posts
    6
    Hi, no sorry, not looking for a sumproduct. Here is what I have...

    =SUMIF((AND(A1:A10="X",B1:B10="Y"),C1:C10)

    where I'm looking to sum Column C for all rows that match the dual column criteria of A and B

  4. #4
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    27,146
    Quote Originally Posted by gd19
    Hi, no sorry, not looking for a sumproduct. Here is what I have...

    =SUMIF((AND(A1:A10="X",B1:B10="Y"),C1:C10)

    where I'm looking to sum Column C for all rows that match the dual column criteria of A and B
    Unless I'm completely misunderstanding your requirement, that's precisely what VBA Noob's SUMPRODUCT() function gives you.

    Why do you think it doesn't? This is the standard way of achieving a multi criteria 'SUMIF', which is something Microsoft in their infinite wisdom didn't cater for. Although it has to be said that SUMPRODUCT() is a pretty powerful general purpose solution for most of these sorts of requests. If you read around the subject you'll find that people have developed it in extremely clever ways that I guess Microsoft never even envisaged.

    HTH

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Homework ??

    Try this array (Ctrl + Shift + enter)

    =SUM(IF(A1:A10="X",IF(B1:B10="y",C1:C10)))
    VBA Noob

+ 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