+ Reply to Thread
Results 1 to 10 of 10

excel sum for multiple criteria

  1. #1
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    excel sum for multiple criteria

    I need solution for sum for multiple criteria.
    I have massive data to sum with multiple conditions, and I can't use "SUMPRODUCT" or SUMIFS like at below.

    What I need is sum for F1,F2,G1 and G2.

    =SUMIFS($B$1:$B$6,$A$1:$A$6,F1)+SUMIFS($B$1:$B$6,$A$1:$A$6,G1)+SUMIFS($B$1:$B$6,$A$1:$A$6,F2)+SUMIFS($B$1:$B$6,$A$1:$A$6,G2)

    Really need to know what other solution do I have other than those.
    Attached Files Attached Files
    Last edited by neovivaldi; 10-07-2015 at 05:02 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: excel sum for multiple criteria

    Why can't you use SUMPRODUCT?

    =SUMPRODUCT(((A1:A6=F1)+(A1:A6=F2)+(A1:A6=G1)+(A1:A6=G2))*(B1:B6))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    If I don't have choice, yes I must use SUMPRODUCT but I really wonder if there is another formula to handle this problem.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: excel sum for multiple criteria

    I don't believe there is. This formula works but doesn't accept cell references as part of the array

    =SUM(SUMIF(A1:A6,{"tomato","banana","melon","kiwi"},B1:B6))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    Can I just give range as criteria?

  6. #6
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    And I know this sumifs returns "0" but I need kind of this.
    =SUMIFS(B1:B6,A1:A6,F1,A1:A6,F2,A1:A6,G1,A1:A6,G2)

    Because F1:G2 criteria changes often I just can't type every time when I use this formula.

    Is there solution to use SUMIFS for this problem?

  7. #7
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    My best wish I could do this.
    =SUMIFS($B$1:$B$6,$A$1:$A$6,$F$1:$G$2)

  8. #8
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    =SUMPRODUCT(SUMIFS(B1:B6,A1:A6,F1:G2))
    It works, I don't know why.

    Am I doing right?

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: excel sum for multiple criteria

    Yes, nicely done.

    Edit: You can do with SUMIF

    =SUMPRODUCT(SUMIF(A1:A6,F1:G2,B1:B6))
    Last edited by ChemistB; 10-07-2015 at 01:34 PM.

  10. #10
    Registered User
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: excel sum for multiple criteria

    Thanks so much everyone.

+ 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. Replies: 5
    Last Post: 07-22-2015, 03:18 AM
  2. [SOLVED] Multiple criteria SUMPRODUCT (3 criteria) Excel 2003
    By lelrich in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2014, 01:58 PM
  3. [SOLVED] UDF for sum of multiple criteria in multiple columns and single criteria in multiple colum
    By Ganesh7299 in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 11-22-2013, 04:26 AM
  4. Filter Excel Data using vba multiple criteria multiple columns
    By pmyk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2013, 01:32 AM
  5. Excel 2007 : Index, Match, Large Formula: Multiple Criteria, Multiple Ranges
    By SimpleJack in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2013, 08:54 AM
  6. Countif, Multiple Criteria, Multiple Sheets, Excel 2003
    By shyammankoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-07-2013, 06:50 AM
  7. Excel Macro (excel for mac 2010) - update multiple excel books on criteria
    By genichigo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2012, 07:23 AM

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