+ Reply to Thread
Results 1 to 19 of 19

Summing data based on several cell contents

  1. #1
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Summing data based on several cell contents

    Wonder if someone can help with this please. I need a formula to give a combination of IF and I think SUMMIFS to calculate totals based on certain cell criteria. Result to be:

    Cell C21 = Total of C2 to C16 where value in column A = UK and value in Coumn B = Orange
    Cell C22 = Total of C2 to C16 where value in column A = UK and value in Coumn B = Apple
    Cell C23 = Total of C2 to C16 where value in column A = UK and value in Coumn B = Pear

    Cell C25 = Total of C2 to C16 where value in column A = USA and value in Coumn B = Orange
    Cell C26 = Total of C2 to C16 where value in column A = USA and value in Coumn B = Apple
    Cell C27 = Total of C2 to C16 where value in column A = USA and value in Coumn B = Pear

    Any assistance would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summing data based on several cell contents

    because you have the word total in it i would use this in c21-c24 =SUMIFS($C$2:$C$16,$A$2:$A$16,"UK",$B$2:$B$16,B21) and this in c25-c27 =SUMIFS($C$2:$C$16,$A$2:$A$16,"Usa",$B$2:$B$16,B25).
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Summing data based on several cell contents

    Hi. I think that this is what you want.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Summing data based on several cell contents

    For UK

    =SUMPRODUCT(($A$2:$A$16=LEFT($A$21,FIND(" ",$A$21)-1))*($B$2:$B$16=$B21)*($C$2:$C$16))

    For USA

    =SUMPRODUCT(($A$2:$A$16=LEFT($A$25,FIND(" ",$A$25)-1))*($B$2:$B$16=$B25)*($C$2:$C$16))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summing data based on several cell contents

    cheating off Alkey's formula, you could adjust mine to be... =SUMIFS($C$2:$C$16,$A$2:$A$16,LEFT($A$21,FIND(" ",$A$21)-1),$B$2:$B$16,B21)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Summing data based on several cell contents

    ...and it would have helped if Id attached the file! Oh well, you now have several other answers...

  7. #7
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    Sorry folks I've tried all of the formulas above in cell C21 and it comes back with #NAME?. I can't see what I am missing here.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summing data based on several cell contents

    both of mine worked in your attachment.

    EDIT: I also tested Alkey's in your attachment and it worked.
    Last edited by Sam Capricci; 06-04-2014 at 01:11 PM.

  9. #9
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. I think that this is what you want.
    Glen if you could copy up your file that'd be really appreciated thanks.

  10. #10
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. I think that this is what you want.
    Glen if you could copy up your file that'd be really appreciated thanks.

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Summing data based on several cell contents

    Please see attached file. Hopefully it will help.
    Attached Files Attached Files

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Summing data based on several cell contents

    OK. Here you are (after a slight delay...)
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    Thanks for all the input folks - sorted - many thanks.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Summing data based on several cell contents

    If that's it can you mark the thread as solved and consider saying thanks to those who helped by clicking the "Add reputation" button at the bottom of the post(s)?

  15. #15
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Summing data based on several cell contents

    Thank you for the feedback!

  16. #16
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    I thought I had this cracked, but still having issues. In the attached file I've used the forumla in column B of the "Summary by Country" tab to add up data based upon country and esource type in the "Test data tab". It works fine for resource type = Eng 1, but is not counting up the date for any other resource type.

    I've been looking at this all morning and can't figure out what may be wrong. Would apprecite any thoughts on what I am doing wrong here please - thanks again.
    Attached Files Attached Files

  17. #17
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summing data based on several cell contents

    your issue is in your merged reference cell in the test data sheet where you merged UK down rows 3-15. the formula is seeing it only once in your summary sheet, if you have UK in each row it will work (same as US). there may be another way but that is just my quick assessment.

    EDIT: UK exists only in cell A3 and US only in A16 so the formula isn't seeing it again in A4, A5 etc.

  18. #18
    Registered User
    Join Date
    07-16-2007
    Posts
    30

    Re: Summing data based on several cell contents

    Quote Originally Posted by Sambo kid View Post
    your issue is in your merged reference cell in the test data sheet where you merged UK down rows 3-15. the formula is seeing it only once in your summary sheet, if you have UK in each row it will work (same as US). there may be another way but that is just my quick assessment.

    EDIT: UK exists only in cell A3 and US only in A16 so the formula isn't seeing it again in A4, A5 etc.
    Great spot, that's exactly what it is, many thanks again.

  19. #19
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summing data based on several cell contents

    you're welcome, and thanks for the feedback.

+ 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. Tagging rows of data based on cell contents
    By fyfey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-15-2014, 10:05 AM
  2. [SOLVED] Summing multiple values based on cell contents
    By NeoFlex in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-08-2013, 04:52 PM
  3. Rows of data based on cell contents
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2013, 09:25 PM
  4. Replies: 10
    Last Post: 07-01-2013, 09:35 PM
  5. Replies: 2
    Last Post: 10-12-2010, 09:14 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