+ Reply to Thread
Results 1 to 12 of 12

Sumif for multiple criteria, criteria ranges and sum ranges

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Sumif for multiple criteria, criteria ranges and sum ranges

    Hey guys,

    I'm trying to do a sumif or sumifs but for multiple criteria ranges and sum ranges based on different criteria. Here is the example so that hopefully it is easier to understand.

    IF column B:B = w or x, sumif(C:C,A1,D:D), IF column B:B = y or z, sumif(E:E,A1,F:F)

    Thanks for your help!

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    i don't know if i understand it correctly but here goes.

    =SUM(SUMIFS(D:D,B:B,{"w","x"},C:C,A1))

    =SUM(SUMIFS(F:F,B:B,{"y","z"},E:E,A1))
    combine the two (add)
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Thanks for the reply vlday. So how would i combine those two equations? i don't actually want to add the two results together, just want have it be all one formula and return one answer. hopefully i can clarify better - those two IF statements I wrote, I'd like them to be combined for ultimately one answer return. So if column B is w or x, do the sumif that searches the criteria range of column C and sums column D. If Column B is y or z, do the sumif that searches the criteria range of column E and sums F. Hopefully that clarifies my intentions. Thanks!

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    You have to add the two sumifs
    how about you have in Column B
    x 1
    x 1
    x 1
    z 2
    z 2
    z 2

    can you post a sample with atleast 10 rows of data and expected result.

  5. #5
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    I have attached a sample data set. There are 3 tabs. The "summary" tab column C is the one to focus on. The numbers I want are already in Column C of the summary tab- except for right now I have two different formulas in Column C to achieve my goal. The cells in yellow have one sumif and the white cells have another sumif. I want to be able to drag down one single formula in the whole Column C and achieve the same numbers. I basically need to combine the 2 formulas in column C so that i don't have to filter to drag down separate formulas depending on what gets added to the next row.

    NOTE: I must keep tabs "1" and tab "2" separate and in separate columns - can't just add tab 2's columns to bottom of tab 1's data. (I deleted out a lot of other data)



    Thanks!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Forgot to add that what is in Column B (w,x,y or z) of the summary tab is determining which sumif to use in Column C.

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    so different sumif for different tabs
    how about
    if statements

    =IF(B2="","",IF(OR(B2="x",B2="w"),SUMIF('1'!A:A,Summary!A2,'1'!B:B),SUMIF('2'!A:A,Summary!A2,'2'!B:B)))
    if B2 is blank return blank
    then check if x or w perform sumif for tab1 otherwise not x or w perform sumif tab2

  8. #8
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    paste that into c2 it should work but i would suggest limiting your data range from A:A,B:B to the maximum rows you will be using.

  9. #9
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    HI,

    check the updated sheet if this is what you are trying to achieve i shall explain you


    Punnam
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Hi,

    If you are interested to learn more about this you can click on below link of the Excel tip's tutorial..........

    http://www.exceltip.com/summing/summ...-criteria.html

    Thanks
    Nisha

  11. #11
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Thanks for all the replies! I ultimately took daveisalwayshere's formula but added one more sumif to include variable 'Z'.

    Punnam, yours was almost perfect - interestingly enough, it added in an additional amount of 200 in line 21 that should not have been included. Not understanding the formula, I'm not sure why it picked up an amount for that row. Maybe you can shed some light or adjust the formula?

    Thanks again to everyone who replied.

  12. #12
    Registered User
    Join Date
    05-24-2012
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    11

    Re: Sumif for multiple criteria, criteria ranges and sum ranges

    Sorry, Punnam, , I misspoke. Your formula does capture everything, there was a slight nuance with the variable for that line 21 in my true data and yours actually picks it up, where I had to make an adjustment before. Can you explain a little more about the formula? Thanks

+ 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: 7
    Last Post: 10-08-2012, 01:53 AM
  2. [SOLVED] how do you make a SUMIF function with two ranges and two criteria
    By martinolooney in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2012, 12:18 PM
  3. Dynamic sumif ranges based on Hlookup criteria
    By Dial1 in forum Excel General
    Replies: 2
    Last Post: 10-24-2011, 01:21 AM
  4. Sumif with 2 ranges of criteria
    By Honey Bee in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-05-2007, 12:52 PM
  5. SUMIF with Mutiple Ranges & Criteria
    By PokerZan in forum Excel General
    Replies: 5
    Last Post: 08-04-2005, 05:31 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