+ Reply to Thread
Results 1 to 7 of 7

Selectively sum values in a table based on a value in a second table?

  1. #1
    Registered User
    Join Date
    03-27-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Selectively sum values in a table based on a value in a second table?

    Hi all. Having a difficult (for me) problem trying to summarize some data.

    Excel spreadsheet attached, but here's the summary:

    I'm trying to sum all hours associated with people who are assigned a specific role.

    For instance, I want to be able to display all time associated with resources who are assigned the role "TA".

    Any help would be *greatly* appreciated.

    Time Table:

    Date Person Hours Cost
    2009-05-04 Mike Smith 3.0 $750
    2009-05-05 John Doe 4.0 $1,000
    2009-05-06 Alice Jones 3.0 $750
    2009-05-07 Alice Jones 8.0 $1,600
    2009-05-08 John Doe 8.0 $2,000
    2009-05-09 Tiger Woods 5.0 $1,200

    Role Table:

    Person Role
    Alice Jones PA
    John Doe TA
    Mike Smith PM
    Tiger Woods TA


    I've tried a number of solutions (in addition to poring over the forums, the internet, Excel help, and anything else I can think of:

    Tried {=SUMPRODUCT((C2:C7)*(VLOOKUP(B2:B7,I3:J6,2,FALSE)="TA"))}
    Tried {=SUM(IF(VLOOKUP(B2:B7,I3:J6,2,FALSE)="TA",C2:C7,0))}
    Tried {=SUMPRODUCT((C2:C7)*(INDEX(I3:J6,MATCH(B2:B7,I3:I6,0),2)="PM"))}


    Thanks much,

    Mike
    Attached Files Attached Files
    Last edited by msilano; 03-28-2010 at 08:22 AM.

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Can't seem to sum all values in a table based on a lookup of another table

    G'day Mike and welcome to the forum.

    See attached should help you out.

    Cheers

    RC
    Attached Files Attached Files
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  3. #3
    Registered User
    Join Date
    03-27-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Can't seem to sum all values in a table based on a lookup of another table

    Ratcat,

    Thank you very much.

    Only one problem - i was trying to do that without adding another column.

    Prolly should have mentioned that in my response.

    Is there any easy way to do it with a lookup?

    Thanks,

    Mike

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Selectively sum values in a table based on a value in a second table?

    A PivotTable is the simplest way
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Selectively sum values in a table based on a value in a second table?

    I've tried a number of solutions (in addition to poring over the forums, the internet, Excel help, and anything else I can think of:

    Tried {=SUMPRODUCT((C2:C7)*(VLOOKUP(B2:B7,I3:J6,2,FALSE)="TA"))}
    Tried {=SUM(IF(VLOOKUP(B2:B7,I3:J6,2,FALSE)="TA",C2:C7,0))}
    Tried {=SUMPRODUCT((C2:C7)*(INDEX(I3:J6,MATCH(B2:B7,I3:I6,0),2)="PM"))}
    Just FYI: Sumproduct does not need to be confirmed with CSE.

  6. #6
    Registered User
    Join Date
    03-27-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Selectively sum values in a table based on a value in a second table?

    Thanks to all that replied. Was trying to avoid pivot tables, but may be the best way.

    Cheers,

    Mike

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Selectively sum values in a table based on a value in a second table?

    Why avoid PivotTables? Combined with a Dynamic Named Range they are much more efficient than attempting to use Array Formulas or even SumProduct.

+ 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