+ Reply to Thread
Results 1 to 10 of 10

Tricky: Sum if either column contains value AND third column contains EITHER of two values

  1. #1
    Registered User
    Join Date
    01-29-2012
    Location
    London, england
    MS-Off Ver
    Excel 2010
    Posts
    9

    Tricky: Sum if either column contains value AND third column contains EITHER of two values

    Hi guys

    In the table below, I want to add the values in row D for when EITHER rows A or B contain "Jill" AND row C contains EITHER "Floor" or "Counter".

    The correct answer should be 5.65 but I really can't figure this formula out - everything I try gives me an error. Any ideas anybody?


    A B C D
    Jill Jay Floor 1.3
    Jane Jill Counter 1.3
    Jay Jane Floor 1.05
    Jill Joe Counter 1.7
    Jay Jill Floor 1.35
    Jane Jay Counter 1.3
    Jill Joe Stop 2.1
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    =SUMPRODUCT(((A1:A7="Jill")+(B1:B7="Jill"))*(C1:C7="Floor")*(D1:D7))+SUMPRODUCT(((A1:A7="Jill")+(B1:B7="Jill"))*(C1:C7="Counter")*(D1:D7))

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    hi omahacrab, how about:
    =SUMPRODUCT((A1:A7="Jill")*(C1:C7={"Floor","Counter"})*(D1:D7))+SUMPRODUCT((B1:B7="Jill")*(C1:C7={"Floor","Counter"})*(D1:D7))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    A little shorter
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-29-2012
    Location
    London, england
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    All 3 solutions work perfectly thank you all indeed! Need to start getting better at this stuff.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    You can find a very nice explanation on SUMPRODUCT at this page

  7. #7
    Registered User
    Join Date
    01-29-2012
    Location
    London, england
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    Thanks a lot Pepe

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    this is kinda cheating, but I added a helper column and then used this, copied down. sum the results and you get 5.65...
    =IF(AND(OR(A1="Jill",B1="Jill"),OR(C1="Floor",C1="Counter")),D1,"")

    Edit: I can never get the sumproduct to work lol
    Last edited by FDibbins; 11-10-2012 at 11:52 AM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Registered User
    Join Date
    01-29-2012
    Location
    London, england
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    Will give this one a try too thanks

  10. #10
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Tricky: Sum if either column contains value AND third column contains EITHER of two va

    Quote Originally Posted by Pepe Le Mokko View Post
    A little shorter
    Please Login or Register  to view this content.
    A little more shorter...

    =SUMPRODUCT(((A1:A7="jill")+(B1:B7="jill"))*(C1:C7={"floor","counter"})*D1:D7)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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