+ Reply to Thread
Results 1 to 12 of 12

SUMIFS only returns the 1st matched value in my range of criterias

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    SUMIFS only returns the 1st matched value in my range of criterias

    Hi guys, im a first time poster here and would like to seek help from you guys on a formula that i am working on. I have a problem having the SUMIFS formula listed below to return the combined value of "SX" plus "BX" plus "HX". All i get is whichever value that i have placed in front, in this case is "SX", and all other criterias behind are kinda ignored. how can i fix this formula?

    =SUMIFS(MCG650R1!$K:$K,MCG650R1!$A:$A,'Offshelf Performance (Overall)'!$U10,MCG650R1!$E:$E,"2012",MCG650R1!$D:$D,{"SX","HX","BX"})

    Thanks in advance.

  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: SUMIFS only returns the 1st matched value in my range of criterias

    isnt it just =SUMIFS(MCG650R1!$K:$K,MCG650R1!$A:$A,'Offshelf Performance (Overall)'!$U10,MCG650R1!$E:$E,"2012",MCG650R1!$D:$D,"SX",MCG650R1!$D:$D,"HX",MCG650R1!$D:$D,"BX") not tested as i havent excel 2007 on this machine
    ah that may not work have you tried
    =sum(SUMIFS(MCG650R1!$K:$K,MCG650R1!$A:$A,'Offshelf Performance (Overall)'!$U10,MCG650R1!$E:$E,"2012",MCG650R1!$D:$D,{"SX","HX","BX"}))
    Last edited by martindwilson; 08-30-2012 at 04:49 AM.
    "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 Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    As Martin says ...
    Please Login or Register  to view this content.
    SUMIF() & SUMIFS() will not accept arrays, they only take Ranges or Values.

    You could look at SUMPRODUCT() maybe for an easier solution

    [EDIT]
    The above formula is wrong, see Post #6
    Last edited by Marcol; 08-30-2012 at 06:13 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

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

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    just checked on my other pc
    =sum(SUMIFS(MCG650R1!$K:$K,MCG650R1!$A:$A,'Offshelf Performance (Overall)'!$U10,MCG650R1!$E:$E,"2012",MCG650R1!$D:$D,{"SX","HX","BX"})) works just fine

  5. #5
    Registered User
    Join Date
    08-30-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    Woot the formula worked. Thx alot! You are such a great help! =)

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    Does it work? ...
    Compare it to this
    Please Login or Register  to view this content.
    SUMIFS() doesn't accept Arrays.
    If you try using an array in an arguement it will only evaluate the first condition.

    [EDIT]
    Long time misunderstanding blown clean out of the water ... see Post#7
    Thanks Joe ...

    @ catzilla
    This is Joes' solution
    Please Login or Register  to view this content.
    See this workbook
    Attached Files Attached Files
    Last edited by Marcol; 08-30-2012 at 07:07 AM.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    it does accept arrays but also returns an array so that's why you need SUM(SUMIFS(...))
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    Excellent information Joseph !!! ...
    I gave up with SUMIF() and arrays years ago, never thought of it actually returning another array.

    There are dozens of others offering tutorials on the net under the same misunderstanding!!! ...

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    in fact Martin had already provided that solution-I was only commenting on it ;-)

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    @ Martin
    My apologies for missing your solution ... I've given myself a real red face here ...

    @ Joe
    Thanks for pointing that out, a lesson well learned, for me at least.
    Last edited by Marcol; 08-30-2012 at 07:50 AM.

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

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    @ catzilla

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMIFS only returns the 1st matched value in my range of criterias

    Quote Originally Posted by Marcol View Post
    SUMIFS() doesn't accept Arrays.
    Well this is actually true to an extent.....

    As demonstrated here you can use an "array" or "array constant" in place of a criterion....although you have to be careful if you have two separate array criteria for two different ranges (and three isn't possible)

    ....but you can't use an array in place of the sum range or the criteria range(s)
    Audere est facere

+ 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