+ Reply to Thread
Results 1 to 6 of 6

SUMIFS with mulitple criteria

  1. #1
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    SUMIFS with mulitple criteria

    Hi All

    So excel seems to permit multiple criteria in a SUMIFS formula - '=SUM(SUMIFS(sum_range,criteria_range,{"red","blue"}))

    I am looking for a way to reference a cell rather than hard define the values e.g. '=SUM(SUMIFS(sum_range,criteria_range,{A4,A5}))

    For example:
    1 R 10
    2 R 10
    3 G 20
    4 G 20
    5 B 30
    6 B 30

    Actual Value
    =SUMIFS(C42:C47,B42:B47,{"R","B"})) - This works

    Reference Value
    =SUM(SUMIFS(C42:C47,B42:B47,{$E$41,$F$41})) - This doesn't work.

    Reference Value
    =SUMIFS(C42:C47,B42:B47,$E$41:$F$41) - This returns on the R value (20)

    Expected value = 80


    Ideally I want to be able to filter on several criteria lists, i.e. Return a sum from several filtered columns using a single formula. is that even possible?

    For example (Values | List One, List Two, List Three)

    Where I could select the items in each list and it would ultimately return the complete summed value of those selections. I could do this using VBA, but if there's a better way using formulas, I'd like to work with that instead.


    Thanks for helps
    Last edited by Journeyman3000; 08-10-2020 at 02:01 AM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: SUMIFS with mulitple criteria

    Basically:
    {X,Y} apply for values only
    If reference:
    (E41:F41)
    SUMIFS(C42:C47,B42:B47,$E$41:$F$41) establish 2 outcome like: {100,200} with 100 is sumif of E41 and 200 of F41
    To sumup, try put in to SUMPRODUCT;

    =SUMPRODUCT(SUMIFS...)
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: SUMIFS with mulitple criteria

    Thanks for the response.

    This is close, but not quite what I'm after.

    I did this: =SUMPRODUCT(SUMIFS(E2:E28,C2:C28,FindList,D2:D28,FruitList)) and SUMIFS(E2:E28,C2:C28,FindList,D2:D28,FruitList)

    Both of these work wherever I do not have a unique list and am matching items directly. E.g.

    Data Table

    Milk Apples $100.00
    Milk Orange $100.00
    Milk Pears $100.00
    Cookies Apples $100.00
    Milk Apples $100.00


    Result

    Milk Apples $200.00
    Milk Orange $100.00
    Milk Pears $100.00
    Cookies Apples $100.00

    Formula
    Milk | Apples =SUMIFS(E2:E28,C2:C28,FindList,D2:D28,FruitList) = $200

    This formula is correct - however, to make it work I need to have two lists with every combination of possible matches.

    I need a single formula that will read a unique List One and unique List Two and tell me the total wherever a match between the two lists is found. So that:

    I need to match only 2 unique Lists.

    List One List Two Result
    Milk Apples $200
    Cookies Pears ---
    Produce Oranges ---

    I tried =SUMIFS(E2:E28,C2:C28,FindList,D2:D28,FruitList), but this only showed direct match total - where I had every combination matching in two columns. That would be useful but not in this scenario.

    Hope that's a little clearer, and thanks for helping.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: SUMIFS with mulitple criteria

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: SUMIFS with mulitple criteria

    I've included an attachment.

    I just need a way to collate the data such that it it calculated based on the selections I've made.

    I hope this attachment helps to get it.

    Cheers
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: SUMIFS with mulitple criteria

    Given that the SUMIFS is giving the result you want, do I take it that this is an aesthetic question to do with accommodating merged cells?

    If so, see here: https://excel.solutions/2016/10/usin...ctively-excel/
    Last edited by AliGW; 08-11-2020 at 02:02 AM.

+ 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. An Array for mulitple SUMIFS
    By BEEROG in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-03-2018, 12:30 PM
  2. Replies: 0
    Last Post: 08-22-2017, 03:49 PM
  3. [SOLVED] Max IF with mulitple Criteria
    By fireguy7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2013, 06:42 PM
  4. Sum Mulitple Column based on the multiple Conditions using sumifs function
    By JEETKAMALARORA in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-20-2012, 03:24 AM
  5. sumifs with mulitple columns and mulitple criteria in each column
    By bkaufman in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-18-2012, 05:11 PM
  6. using mulitple criteria
    By Janie in forum Excel General
    Replies: 1
    Last Post: 05-11-2010, 01:59 PM
  7. mulitple criteria
    By imjustme in forum Excel General
    Replies: 8
    Last Post: 09-01-2005, 10:05 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