+ Reply to Thread
Results 1 to 5 of 5

can lookup be used for two criteria and combined with sum

  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    can lookup be used for two criteria and combined with sum

    In my spreadsheet I have three columns. The first is an ID number, the second is a category and the third is a value. I would like to sum all items that match both the ID and a category.

    For example, say I have the following data in columns A, B, C:

    A, B, C
    101, large, 10
    101, large, 5
    101, small, 8
    101, curly, 3
    101, small, 11
    101, round, 14
    102, curly, 2
    102, large, 10
    102, large, 5
    102, round, 8
    102, curly, 3
    102, small, 11
    102, huge, 14
    102, round, 2

    So, I would like to find all the lines with ID 101 and large and sum the results from column 3. So, for that lookup, the result would be 15 (it would add the first two lines which both match 101 and large).

    Is this possible?

    Thanks in advance.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: can lookup be used for two criteria and combined with sum

    Hello & Welcome to the Forum,

    For 2003 you can use
    =SUMPRODUCT(--($A$1:$A$14=101),--($B$1:$B$14="Large"),$C$1:$C$14)

    or

    =SUMPRODUCT(--($A$1:$A$14=$E$1),--($B$1:$B$14=$F$1),$C$1:$C$14)

    where E1 = 101 and F1 = Large

    For 2007+
    =SUMIFS($C$1:$C$14,$A$1:$A$14,101,$B$1:$B$14,"Large")

    or

    =SUMIFS($C$1:$C$14,$A$1:$A$14,$E$1,$B$1:$B$14,$F$1)

    where E1 = 101 and F1 = Large
    HTH
    Regards, Jeff

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: can lookup be used for two criteria and combined with sum

    Two additional options:

    1. Pivot Table (recommended) - offers the greatest flexibility and ease to change criteria
    2. SUBTOTAL function used in conjunction with auto-filter.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Registered User
    Join Date
    05-25-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: can lookup be used for two criteria and combined with sum

    I went with sumifs since that seemed to be exactly what I was looking for and it worked perfect.

    Thanks so much for the help.

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

    Re: can lookup be used for two criteria and combined with sum

    I went with sumifs
    Then you should change your profile to reflect what version of Excel you are using because SUMIFS() doesn't work in 2003.

+ 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