+ Reply to Thread
Results 1 to 4 of 4

Find value in table based on two inputs

  1. #1
    AMDRIT
    Guest

    Find value in table based on two inputs

    Given

    A1: Name B1: Dept C1: Age
    A2: Henry B2: 501 C2: 28
    A3: Stan B3: 201 C3: 19
    A4: Mary B4: 101 C4: 22
    A5: Larry B5: 301 C5: 29


    how would write a formula to find the age of 'Mary' in dept '101'?

    vlookup doesn't seem to support multiple compares.


    Thanks



  2. #2
    Roger Govier
    Guest

    Re: Find value in table based on two inputs

    Hi

    Try
    =SUMPRODUCT(--(A2:A5="Mary"),--(B2:B5=102),--(C2:C5))
    or better still, put Name required in cell D1 and Dept required in E1
    then
    =SUMPRODUCT(--(A2:A5=D1),--(B2:B5=E1),--(C2:C5))
    Change values in D1 and E1 for other selections.
    --
    Regards

    Roger Govier


    "AMDRIT" <[email protected]> wrote in message
    news:[email protected]...
    > Given
    >
    > A1: Name B1: Dept C1: Age
    > A2: Henry B2: 501 C2: 28
    > A3: Stan B3: 201 C3: 19
    > A4: Mary B4: 101 C4: 22
    > A5: Larry B5: 301 C5: 29
    >
    >
    > how would write a formula to find the age of 'Mary' in dept '101'?
    >
    > vlookup doesn't seem to support multiple compares.
    >
    >
    > Thanks
    >
    >




  3. #3
    Bernard Liengme
    Guest

    Re: Find value in table based on two inputs

    Assume the data is in A1:C200 with header in row 1
    Insert new column C; in C2 enter =A2&B2 and copy down the column
    With name to be found in G1 and dept in H1 use
    =VLOOKUP(G1&H1,C2:D200,2,FALSE) to locate the age
    Note that the column with concatenated data may be hidden and lookup will
    still work
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "AMDRIT" <[email protected]> wrote in message
    news:[email protected]...
    > Given
    >
    > A1: Name B1: Dept C1: Age
    > A2: Henry B2: 501 C2: 28
    > A3: Stan B3: 201 C3: 19
    > A4: Mary B4: 101 C4: 22
    > A5: Larry B5: 301 C5: 29
    >
    >
    > how would write a formula to find the age of 'Mary' in dept '101'?
    >
    > vlookup doesn't seem to support multiple compares.
    >
    >
    > Thanks
    >
    >




  4. #4
    AMDRIT
    Guest

    Re: Find value in table based on two inputs

    Thanks for the quick responses gang. I really appreciate it. Sometimes I
    can't see the forest for the trees.


    "AMDRIT" <[email protected]> wrote in message
    news:[email protected]...
    > Given
    >
    > A1: Name B1: Dept C1: Age
    > A2: Henry B2: 501 C2: 28
    > A3: Stan B3: 201 C3: 19
    > A4: Mary B4: 101 C4: 22
    > A5: Larry B5: 301 C5: 29
    >
    >
    > how would write a formula to find the age of 'Mary' in dept '101'?
    >
    > vlookup doesn't seem to support multiple compares.
    >
    >
    > Thanks
    >
    >




+ 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