Some Kind of VLOOKUP?

LemonRage

New Member
Joined
Oct 6, 2008
Messages
25
Hello all. I am trying to clean up some data that I have and have the following two tables:


Employee ID Start Date End Date Cost Center
1 01/01/2009 05/01/2009 12345
1 05/02/2009 06/15/2010 123456
1 06/16/2010 12/31/9999 1234567
2 01/03/2011 04/01/2011 10101
2 04/02/2011 12/31/9999 101010

Employee ID Paid Date
1 03/21/2009
1 07/17/2010
2 03/13/2011
2 04/02/2011

My goal is to get the correct cost center for the second table based on the paid dates...The Paid date should fall in the range as given in the first table. I've tried a vlookup and use "1" instead of "0" for the range lookup, but I keep getting bad results. Any suggestions? -William
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
LemonRage,


Somehting like this?


Excel Workbook
ABCDEFGH
1Employee IDStart DateEnd DateCost CenterEmployee IDDateCost Center
2101/01/200905/01/200912345103/21/200912345
3105/02/200906/15/2010123456107/17/20101234567
4106/16/201012/31/99991234567203/13/201110101
5201/03/201104/01/201110101204/02/2011101010
6204/02/201112/31/9999101010
7
Sheet1





The array formula in cell H2, confirmed with CTRL + SHIFT + ENTER (not just ENTER), and copied down:

=INDEX($D$2:$D$6,MATCH(1,IF($A$2:$A$6=F2,IF(G2>=$B$2:$B$6,IF(G2<=$C$2:$C$6,1)))))
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top