Vlookup and comparing two date ranges

Drewster1

New Member
Joined
May 12, 2014
Messages
1
Hi guys,

I often search this forums for advice for issues, you guys have been great. Today I come to you with my own problem. \

My goal is to fill in 'Number of days' using a Vlookup function with the number of days from Date sheet 2. Still not sure what the best way to do it is, either specifying the number of days or sum product total days if the dates in Data Sheet 1 correspond with dates in the Data Sheet 2.

Thanks for the help Drew

Data sheet 1
ABCDE
1Employee IDLeave start dateLeave end dateOverlapping dates (Y/N)Number of days
220012327/04/20116/01/2012
320012316/01/201226/02/2012
420012322/04/201427/05/2014
520045601/03/201001/09/2010

<tbody>
</tbody>

Data sheet 2
ABCD
1Employee IDStart DateEnd DateDays taken
22001234/05/201131/05/201126
320012322/01/201229/01/20127
420012311/05/201413/05/20142
52004569/06/201011/06/20103

<tbody>
</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
not clear what you want? my regional configuration compels me to enter date as m/d/yy
I have only formatted as x/m/yy. but actual entry you can see in formula bar.
sheet is like this

Sheet1

*ABCDE
1Employee IDLeave start dateLeave end dateOverlapping dates (Y/N)Number of days
220012327-Apr-116-Jan-12yes254
320012316-Jan-1226-Feb-12yes41
420012322-Apr-1427-May-14yes35
52004561-Mar-101-Sep-10yes184

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:85px;"><col style="width:106px;"><col style="width:102px;"><col style="width:159px;"><col style="width:106px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D2=IF(AND(B2<=Sheet2!B2,Sheet1!C2>=Sheet2!C2),"yes","no")
E2=C2-B2

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4


sheet 2 is

Sheet2

*ABCD
1Employee IDStart DateEnd DateDays taken
22001234-May-1131-May-1126
320012322-Jan-1229-Jan-127
420012311-May-1413-May-142
52004569-Jun-1011-Jun-103

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:85px;"><col style="width:75px;"><col style="width:75px;"><col style="width:74px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4


in sheet 1 see formulas in C2 ad D2 wich is copied down.
is this what you want?
 
Upvote 0

Forum statistics

Threads
1,216,114
Messages
6,128,913
Members
449,478
Latest member
Davenil

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