+ Reply to Thread
Results 1 to 6 of 6

Conditional sum with linked conditions in different tables

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    62

    Conditional sum with linked conditions in different tables

    Hi!

    I have two tables: one giving the link between a person and his job

    Chelsea Architect
    John Driver

    and a second one, which says, who works in what week

    John 1 1
    Chelsea 1

    I'd like to know, let's say, how many architects work in what week. In other words, I'd like to sum all the values of people, who are architects.

    Does somebody have an idea, how to "make Excel know" that Chelsea is an architect?

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Conditional sum with linked conditions in different tables

    What's the point in having two tables?
    Can one person have more than one job?

    The easiest way is to add a helper column to Sheet "Input2", say Column B, this will avoid nasty array formulae.
    Then in B2
    Please Login or Register  to view this content.
    Drag/Fill Down

    And in Sheet "Result" B2
    Please Login or Register  to view this content.
    Drag Across to Column D, then down.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    62

    Re: Conditional sum with linked conditions in different tables

    Hi Marcol

    Thanks for your reply! The point of having several tables is for maintenance: I would like to pass this Excel sheet to people who don't know Excel. They should be able to copy and paste their tables (which have a given configuration) without having to think too much.

    A person can have only one job, but a person can have several "presence lines".

    Here's a sheet which contains vectors I wish (without the formulas to obtain them).

    Thanks!
    Attached Files Attached Files
    Last edited by ExcelStefan; 06-07-2012 at 10:58 AM.

  4. #4
    Registered User
    Join Date
    06-05-2012
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    62

    Re: Conditional sum with linked conditions in different tables

    What is needed is a vector (array), which checks a condition for every element of the vector. With

    Jack 1 1 1
    John 1 1
    Chelsea 1
    Nina 1
    Jim 1 1
    Jim 1 1 1

    And

    Chelsea Architect
    John Driver
    Jack Driver
    Nina Salesperson
    Jim Salesperson

    We need the following vector (which checks e.g. the job "Salesperson" at every name in the first table):

    0
    0
    0
    1
    1
    1

    Does somebody know how to make a formula which returns a vector (array) with a condition? I imagine a function like =IF returning an array.

  5. #5
    Registered User
    Join Date
    06-05-2012
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    62

    Re: Conditional sum with linked conditions in different tables

    I have found a partial solution. I get the array

    Jack Driver
    John Driver
    Chelsea Architect
    Nina Salesperson
    Jim Salesperson
    Jim Salesperson

    Now, I would like to avoid writing down this array, but rather include the corresponding [code] =VLOOKUP($I$20:$I$25;$I$7:$J$11;2;0) [code] in the final [code] =SUMMENPRODUKT(($G$8:$G$13=$A3)*($J$19:$L$19=B$1);$J$20:$L$25) [code] Until now, it doesn't work.
    Attached Files Attached Files

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Conditional sum with linked conditions in different tables

    Seems that the only problem with the solution I offered in post #2, was where I chose to put the helper column.

    See if this suits you better
    You can hide the helper (Sheet "Result" "Convert Input2!A:A") with the grouping button if you want to.
    Attached Files Attached Files

+ 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