Check if leave dates clash with special duty

Ashtagon

New Member
Joined
May 6, 2011
Messages
1
I have a table with the following columns:

* Name
* Special duty role
* On special duty at [time/weekday combo]

And another table with the following

* Name
* On leave from [date]
* On leave until [date]

I want to create a formula on the second sheet that will check if the person's leave dates will clash with the date/timeslots in which that person is on special duty. Instinct tells me this is a vlookup() or index() function, but the exact formula is likely rather complex.

Help?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi Ashtagon,

Welcome to MrExcel.

I think the solution to your problem would be easier to find if you could split the time and weekday into 2 columns, is this possible?

Excel Workbook
ABCD
1NameSpecial Duty RoleDateTime
2BillDuty101/05/201106:00
3TomDuty202/05/201108:00
4BobDuty303/05/201110:00
5PatDuty404/05/201109:00
6JanDuty505/05/201114:00
7JonDuty606/05/201112:00
8JimDuty707/05/201118:00
9TimDuty808/05/201104:00
10PatDuty102/06/201106:00
11JanDuty203/06/201108:00
12JonDuty304/06/201110:00
13JimDuty405/06/201109:00
14TimDuty506/06/201114:00
15BillDuty607/06/201112:00
16TomDuty708/06/201118:00
17BobDuty809/06/201104:00
Sheet1


You would then probably need an Index/Match with multiple criteria to return the Duty.

Excel Workbook
ABCD
1NameOn Leave FromOn Leave UntilSpecial Duty Role
2Bill28/04/201102/05/2011Duty1
3Tom05/05/201106/05/2011*
4Bob09/05/201102/06/2011*
5Pat02/06/201107/06/2011Duty4
6Jan03/06/201104/06/2011Duty2
7Jon20/06/201127/06/2011*
8Jim08/08/201128/08/2011*
9Tim04/06/201112/06/2011Duty5
Sheet2


I don't have a formula solution for you, but if you can alter your data I'm sure someone will provide one now this has been bumped up.

Good luck.

Ak
 
Upvote 0
Hi Ashtagon,

In the absence of any other replies, will this work for you?.....

Excel Workbook
ABCDEF
1NameOn Leave FromOn Leave UntilSpecial Duty RoleDateCheck
2Bill28/04/201102/05/2011Duty101/05/20111
3Tom05/05/201106/05/2011#N/A#N/A0
4Bob09/05/201102/06/2011#N/A#N/A0
5Pat02/06/201107/06/2011Duty102/06/20111
6Jan03/06/201104/06/2011Duty203/06/20111
7Jon20/06/201127/06/2011#N/A#N/A0
8Jim08/08/201128/08/2011#N/A#N/A0
9Tim04/06/201112/06/2011Duty506/06/20111
Sheet2


The formula in D2 needs to be entered using ctrl shift enter NOT enter.
You can then copy it across to E2 and then down as far as you require.
The formula in F2 needs to be copied down, this is used for Conditional Formatting to Highlight the row if a date falls between the Leave dates.
The CF formula is =$F2>0

There is probably a better solution, but I hope this helps.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,610
Members
452,931
Latest member
The Monk

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