+ Reply to Thread
Results 1 to 10 of 10

SUMIFS with multiple criteria in criteria1

  1. #1
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    SUMIFS with multiple criteria in criteria1

    Hello

    When using SUMIFS is there a way you can set the criteria to be one of multiple values?

    So in the example below I might want my criteria to be peter or paul. If I put it as a second criteria it has to meet both conditions.

    =SUMIFS(B:B,A:A,"Peter")

    So where Peter appears how can I say Peter or Paul? Or even better a range of cells


    A B
    Peter 5
    John 6
    Paul 7

    Thanks

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: SUMIFS with multiple criteria in criteria1

    Maybe something like;
    =SUM(SUMIFS(B:B,A:A,{"Peter","Paul"}))
    ?
    or for a range of cells, I think you might be able to do:
    =SUM(SUMIFS(B:B,A:A,C1:C2))
    as an array formula (confirm with ctrl+shift+enter)

  3. #3
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: SUMIFS with multiple criteria in criteria1

    Thanks

    {=SUMIFS(A:A,B:B,C1:C3)} Doesn't work. I just tried. It only returns the value of C1 and not C1+C2+C3

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    12,305

    Re: SUMIFS with multiple criteria in criteria1

    You misread - it's:
    =SUM(SUMIFS(A:A,B:B,C1:C3))
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: SUMIFS with multiple criteria in criteria1

    SUMPRODUCT is also fine:

    =SUMPRODUCT(SUMIFS(A:A,B:B,C1:C3))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: SUMIFS with multiple criteria in criteria1

    That works great.

    Only thing is where C1:C3 appears do these have to be in an array? I can't specify C1,C3 can I?

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: SUMIFS with multiple criteria in criteria1

    You mean you want to be able to choose which elements from C1:C3 are included? In that case, can't you just use the array constant form (as given in post #2) and type your criteria in?

    I could give you a formula which will work for the range C1:C3, but just include whichever elements of that range you want to include, e.g the 1st and 3rd, though you'd still have to manually go into the formula to specify which cells to include every time you wanted to change the cells to be included.

    Regards

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: SUMIFS with multiple criteria in criteria1

    I'm not sure, if it's just those two you could try:
    =SUMIFS(B:B,A:A,C1)+SUMIFS(B:B,A:A,C3)

  9. #9
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: SUMIFS with multiple criteria in criteria1

    It would be more than just those 2. It's quite a few cells but I simplified it for my example. XOR XL which formula would you use?

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: SUMIFS with multiple criteria in criteria1

    I would suggest using the formula in posts 2-5 and changing your data so they are in a continuous set of cells.

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: SUMIFS with multiple criteria in criteria1

    =SUMPRODUCT(SUMIFS(A:A,B:B,INDEX(C1:C3,N(IF(1,{1,3})))))

    Change the {1,3} as required.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autofilter criteria is only picking up Criteria1
    By cath1509 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2013, 07:18 PM
  2. Replies: 2
    Last Post: 01-23-2013, 06:25 AM
  3. Replies: 3
    Last Post: 11-21-2012, 04:57 PM
  4. Replies: 1
    Last Post: 05-16-2011, 05:00 PM

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