Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Vlookup using 2 variables

Latest post Mon, Mar 15 2010 4:25 AM by Bob Phillips. 2 replies.
  • Sun, Mar 14 2010 1:06 PM

    • kiteman22
    • Not Ranked
    • Joined on Sun, Mar 14 2010
    • Posts 1
    • Points 21

    Vlookup using 2 variables

    I am currently putting together a database of timesheets which contain Name, date,  hours (plus others, but these are main ones). I need to lookup into a standing data table two criteria, the name and the date. The standing data consists of name, date of rate change and new rate. Therefore I need to find the person and rate applicable at date of timesheet. I have put something together using index and match but this only works for exact date matches. Any suggestions??

    • Post Points: 21
  • Sun, Mar 14 2010 1:35 PM In reply to

    • Omar
    • Top 10 Contributor
    • Joined on Sat, Jan 12 2008
    • Kitchener, ON
    • Posts 86
    • Points 1,277

    Re: Vlookup using 2 variables

    I'm sure there are better ways, but I did something like that recently with a calculated column in the data table. I basically concatenated the two columns I needed matches for into a third column (formula was simple, "=a1&b1"), and did the vlookup (or index/match) on that column.

    Omar Freeman Kitchener, ON

    • Post Points: 21
  • Mon, Mar 15 2010 4:25 AM In reply to

    Re: Vlookup using 2 variables

    Assuming that the rates table is in strict ascending date orde, this should work

     

    =INDEX(rates.table,MATCH(ts.date,IF(INDEX(rates.table,0,1)=name,INDEX(rates.table,0,2)),1),3)

    Regards

    Bob

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright Excel User Group and the relevant contributors, 2009. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.