+ Reply to Thread
Results 1 to 19 of 19

SUMIFS with multiple criteria between sheets

  1. #1
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    SUMIFS with multiple criteria between sheets

    Hi Guys,

    I'm trying to sum data based on a the criteria of a date being between a certain range and sorted by a particular name.

    I have included a sample sheet with two tabs:

    Totals-I would like to get the sum of the hours a person worked in the range of dates being 1/1/2014-1/24/2014 (which is D1 and E1 in the current charges sheet)
    Current Charges-this is the page that I would like to gather the information from.


    Below is a sample of the formula I was trying to use, but I get an error....my interpretation of what I was trying to input is as follows: Sum C2:C34 in the current charge sheet if B2:B34 is greater than or equal to D1 on the current charges tab (which is 1/1/2014) and B2:B34 is less than or equal to E1 (which is 1/24/2014) with A4:A34 in the current charges sheet equal to A2 on Totals sheet.

    SUMIFS('Current Charges'!C2:C34,'Current Charges'!$B$2:$B$34,">="&'Current Charges'!$D$1,Current Charges'!$B$2:$B$34,"<="&'Current Charges'!$E$1,'Current Charges'!$A$4:$A$34,A2)


    Test Data:

    SUMIFS Test Data.xlsx

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: SUMIFS with multiple criteria between sheets

    try in total sheet b2
    =SUMPRODUCT((YEAR('Current Charges'!$B$2:$B$34)=Totals!B$1)*('Current Charges'!$A$2:$A$34=Totals!$A2)*('Current Charges'!$C$2:$C$34))
    drag to right and down

    for dates in D1 and E1 try below in C2 and drag down
    =SUMPRODUCT(('Current Charges'!$B$2:$B$34>='Current Charges'!$D$1)*('Current Charges'!$B$2:$B$34<='Current Charges'!$E$1)*('Current Charges'!$A$2:$A$34=Totals!$A2)*('Current Charges'!$C$2:$C$34))
    Last edited by hemesh; 03-21-2014 at 03:34 PM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    I didn't look at your file...

    All the ranges need to be the same size:

    'Current Charges'!C2:C34
    'Current Charges'!$B$2:$B$34
    'Current Charges'!$A$4:$A$34
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Hi Hemesh,

    Looks like your first formula worked the best for me, so I will try it in the original sheet and see what happens.

    For some reason I couldn't get your second formula to do quite what I wanted it to do in the Test Data

    Thanks for your help!

  5. #5
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Ok, not quite sure where you going with this, maybe elaborate? I have my range from $A$4:$A$34 .......I just wanted that range to match A2 as one of the two criteria. I am not an expert in this though, so I'm sure you are seeing something that I am not seeing.

    Thanks for your response

    Quote Originally Posted by Tony Valko View Post
    I didn't look at your file...

    All the ranges need to be the same size:

    'Current Charges'!C2:C34
    'Current Charges'!$B$2:$B$34
    'Current Charges'!$A$4:$A$34

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    All of the ranges have to be the same size...

    'Current Charges'!C2:C34
    'Current Charges'!$B$2:$B$34
    'Current Charges'!$A$4:$A$34

    The ranges for columns B and C are the same size, 33 rows.

    The range for column A is not the same size as the ranges for columns B and C. Range for column A is only 31 rows.

    If the ranges are not all the same size then you'll get a #VALUE! error.

  7. #7
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Ah, got it, thanks.

    I fixed that, but still had an error with that formula...and the one that I used from the guy above doesn't seem to work either....I switched it up though, so it is probably an error in how I am interpreting the formula.

    =SUMPRODUCT((YEAR('Current Charges'!F4:F1023)='Total HH PHS 3'!E6)*('Current Charges'!D4:D1023='Total HH PHS 3'!A8)*('Current Charges'!G4:G1023))


    Sheet
    Total HH PHS 3=Totals

    compared with his formula

    =SUMPRODUCT((YEAR('Current Charges'!$B$2:$B$34)=Totals!B$1)*('Current Charges'!$A$2:$A$34=Totals!$A2)*('Current Charges'!$C$2:$C$34))

    I'm not seeing what I am doing wrong....can you see anything?

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    The formula is syntactically correct (but has a superfluous set of parentheses).

    What error are you getting?

    You'll get errors if:

    There are text entries in the date range.
    There are text entries in the sum range.

  9. #9
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Well, neither, it's just coming back blank, when I know that there are values that sum up to the amount....no error messages, just a blank square

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    Ok, that formula should return something.

    Do you have display of zero values turned off?

    I'm getting ready to call it a day. I'll check back tomorrow.

  11. #11
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    It seems to be working for the most part in my sample.....what are other common errors people tend to make?

    My formula for actual
    =SUMPRODUCT((YEAR('Current Charges'!$F$4:$F$1021)=E$6)*('Current Charges'!$D$4:$D$1021=$A8)*('Current Charges'!$G$4:$G$1021))



    I made the sample a bit more realistic....it seems to be working okay

    =SUMPRODUCT((YEAR('Current Charges'!$B$4:$B$244)=D$4)*('Current Charges'!$A$4:$A$244=$A5)*('Current Charges'!$C$4:$C$244))
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: SUMIFS with multiple criteria between sheets

    You want that the year on B4:b244 = year on d4?
    change the formula to this:
    Please Login or Register  to view this content.
    Click (*) if you received helpful response.

    Regards,
    David

  13. #13
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Yes, I want it to first sort through the column and find D4 and the in the 2014 column (E4) find dates that fall within that range as well....it actually seems to be working on the sample, but not so much on the real thing....I actually don't know if there is a common error I am making, or what.

    thanks for your response.

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    Based on the data in your sample file, this formula entered on the Totals sheet in cell B2:

    =SUMPRODUCT(--('Current Charges'!$A$4:$A$244=$A2),--(YEAR('Current Charges'!$B$4:$B$244)=B$1),'Current Charges'!$C$4:$C$244)

    Copy across to C2 then down as needed.

    Here's the file with this implemented:

    SUMIFS Test Data(1).xlsx

  15. #15
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Thanks guys, all of these responses seem like they should work-seeing as though they worked in the sample data that had the same criteria.

    Not sure what the issue is, but I will consider this a done deal for now. Have a great week!

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    That sounds like the formula in your real file is still not returning a correct result?

    If that's the case the only way to solve this is to post the file so we can see what the problem may be.

  17. #17
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Maybe in a more private way, there are names in the file so I don't want to show the world, lol.

    Yeah, the problem is when I try to use the formula in the actual file, from what I see in the examples it should work, but it is coming up blank
    Last edited by PrncssJ; 03-24-2014 at 11:25 AM. Reason: added info

  18. #18
    Registered User
    Join Date
    05-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: SUMIFS with multiple criteria between sheets

    Ha! I found out what the problem was! In my date, I used '2014 instead of changing it to a number with zero decimals...I feel like an idiot, but hopefully this can help someone else in the future!


    Thanks for all of you guys time, come to Colorado and a beer is on me!

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMIFS with multiple criteria between sheets

    Persistence pays off.

    Good deal. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Using a SUMIFS across multiple sheets with multiple criteria
    By Auto667 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2013, 06:55 AM
  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
  5. Lookup sheets & sumifs criteria
    By tek9step in forum Excel General
    Replies: 2
    Last Post: 05-28-2009, 04:32 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