+ Reply to Thread
Results 1 to 7 of 7

vlookup with unique multiple criteria

  1. #1
    Registered User
    Join Date
    04-14-2009
    Location
    Harlem, NYC
    MS-Off Ver
    Excel 2003
    Posts
    3

    vlookup with unique multiple criteria

    Im just going to start with the tables that will help show what i am trying to do...

    TABLE 1
    File # Date id
    2 15 ?
    2 11 ?
    2 7 ?
    2 6 ?

    TABLE 2
    File # Start Stop id
    2 9 13 1
    2 14 16 2
    2 1 8 3

    Ok so say i have these two tables...i want to be able to look at the file # of line 1 in table 1, go to table 2 and return the id where the date from table 1 is between the start and stop in table 2. ie...in that example it should return id "2"

    Ive been playing with vlookup to do this, but have gotten no where because it just takes the first match it finds. Any help will be greatly appreciated

    thnx in advance

    -reilly
    Last edited by NBVC; 04-15-2009 at 02:06 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vlookup with unique multiple criteria

    attach a workbook with it laid out as you want showing the result you'd expect please
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: vlookup with unique multiple criteria

    See attached:

    Formula used is:

    =SUMPRODUCT(--($F$2:$F$4=A2),--($G$2:$G$4<=B2),--($H$2:$H$4>=B2),$I$2:$I$4)

    copied down
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    04-14-2009
    Location
    Harlem, NYC
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: vlookup with unique multiple criteria

    thanks for the response.

    that formula is exactly what i want to achieve, but it doesn't work for me because my id's are actually an combination of letters and numbers so it returns 0's everytime for me.

    I have attached a spreadsheet that should give an idea of my issue

    Thanks again

    Reilly
    Attached Files Attached Files

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: vlookup with unique multiple criteria

    You'll have to change formula then... that only works if the ID's were numbers...

    Try:

    Please Login or Register  to view this content.

    which you must confirm with CTRL+SHIFT+ENTER
    not just ENTER. Then copy it down the column.

    See attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-14-2009
    Location
    Harlem, NYC
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: vlookup with unique multiple criteria

    wow thnx for the quick response, i think that formula just might do it

    thnx again,

    Reilly

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: vlookup with unique multiple criteria

    Great!

    Can you please mark your thread as Solved?

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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.6.0 RC 1