+ Reply to Thread
Results 1 to 7 of 7

Thread: Sum Values in Table If Criteria Exists In Another Table

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Sum Values in Table If Criteria Exists In Another Table

    I am trying to sum the values in one table based on the existence of the criteria in another table. See the attached worksheet. I am looking at SUMIFS as a starting point but hit an issue where I cannot seem to get the current criteria value to do the lookup on the other table.

    Any thoughts?
    Attached Files Attached Files
    Last edited by colinbo; 08-04-2011 at 12:20 PM.

  2. #2
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Sum Values in Table If Criteria Exists In Another Table

    Hello,

    you may need to insert a column in the sheet "Remaining work over time" to display the team for the task ID. Then you can use Sumifs or Sumproduct easily to sum the data.

    Insert a column after A and enter this formula

    =INDEX('Team-Task Links'!$A$1:$A$18,MATCH('Remaining Work over Time'!A2*1,'Team-Task Links'!$B$1:$B$18,0))
    Copy down.

    Note that from row 19 onwards, the numbers are stored as text, hence the *1 in the formula to coerce them back to numeric values for the Match() function to work.

    cheers,

  3. #3
    Registered User
    Join Date
    08-03-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Sum Values in Table If Criteria Exists In Another Table

    Quote Originally Posted by teylyn View Post
    you may need to insert a column in the sheet "Remaining work over time" to display the team for the task ID
    That's what I am trying to avoid. The task type in the cube does not have the team linked to it. The secondary sheet comes from an extra view I created to do the linking at the database level. Both data sheets are actually Pivot Tables (copied into normal cells for the sake of the example).

  4. #4
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,453

    Re: Sum Values in Table If Criteria Exists In Another Table

    Hello Colinbo,

    Try this in C2, copy down.

    =HLOOKUP(A2,'Remaining Work over Time'!$B$1:$M$23,MATCH(VLOOKUP(B2,'Team-Task Links'!$A$2:$B$18,2,0),'Remaining Work over Time'!$A$1:$A$23,0),0)

    There are 6 different Task ID for each team. This formula only return the first ID information.
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  5. #5
    Registered User
    Join Date
    08-03-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Sum Values in Table If Criteria Exists In Another Table

    Quote Originally Posted by Haseeb A View Post
    Hello Colinbo,

    Try this in C2, copy down.

    =HLOOKUP(A2,'Remaining Work over Time'!$B$1:$M$23,MATCH(VLOOKUP(B2,'Team-Task Links'!$A$2:$B$18,2,0),'Remaining Work over Time'!$A$1:$A$23,0),0)

    There are 6 different Task ID for each team. This formula only return the first ID information.
    I need the sum for the team for each day though?

  6. #6
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,453

    Re: Sum Values in Table If Criteria Exists In Another Table

    In the third sheet 'Team-Task Links' If teams are grouped, tr this,

    =SUMPRODUCT(SUMIFS(INDEX('Remaining Work over Time'!$B$2:$M$23,0,MATCH($A2,'Remaining Work over Time'!$B$1:$M$1,0)),'Remaining Work over Time'!$A$2:$A$23,INDEX('Team-Task Links'!$B:$B,MATCH($B2,'Team-Task Links'!$A:$A,0)):INDEX('Team-Task Links'!$B:$B,MATCH($B2&"ZZZZ",'Team-Task Links'!$A:$A))))
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  7. #7
    Registered User
    Join Date
    08-03-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Sum Values in Table If Criteria Exists In Another Table

    I think there one word that best expresses the formula you threw together...

    WOW!

    Works like a charm and cuts out a whole raft of VBA so we can finally use Excel Web Access web parts with the sheet. Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0