Find the last date of Annual Leave for person

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,434
Hello Guys,

I got two files - one is for rostering, and the other one is for leave allocation and record of leave.

In the rostering file, I got a formula that tells me whether a person is on leave for the current week or not. If he is on leave, his name will get highlighted in yellow. To make things easier, I am posting a portion of the file here:
Excel Workbook
ABCDEF
701MATAU
8A/L2REEVEA/L 15/05/11
Weekly Roster


Now, as you can see I have inserted a date in cell F8 showing the last date for this person to be on leave. Is there a formula that I can use to put this date by itself?

I will show the other file here as well to give you better idea to work out the formula.
Excel Workbook
JKLMNO
2Name2010
328-Dec4-Jan11-Jan18-Jan25-Jan
43-Jan10-Jan17-Jan24-Jan31-Jan
5123456
6Both Depots Total4546444217
7Sandringham Total45542
8Balance + or - on Leave#REF!#REF!#REF!#REF!#REF!
9Footscray on LeaveTotal4141393815
10AM Drivers on Leave222220208
11Relief Drivers on Leave11100
12Balance + or - on Leave#REF!#REF!#REF!#REF!
13PM Drivers on Leave181818187
14Sandringham Total45542
15ADDICOTT
16AGGETT
Leave Approved


Any help would be greatly appreciated.

Asad
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Another thing I forgot to mention is that it is quite usual for a person to have 2, or 3 or more lots of holidays in a year and hence the file will may have any number of blocks for a person. I need the formula to look at the block of holidays which will be represented by 1s in adjascent cells in a row under the relevant dates (dates as you can see in my previous post are week beginning date - Monday, and week ending date - Sunday).
 
Upvote 0
I tried this formula but it gives me a message to check for "-" or "=" signs :confused:. The formula I made is like this:
Code:
IF(A8 < > $A$5,"",min(IF(len(columns(INDEX('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),MATCH($BB$1,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$4,0))):index('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),163)) < 0,index('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$4,1,columns(INDEX('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),MATCH($BB$1,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$4,0))):index('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),163)))))
 
Upvote 0
I worked out the following formula.
Code:
=IF($A8 < > $A$5,"",INDEX('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$A$4:$FP$4,1,MIN(IF(LEN(INDEX('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),MATCH($BB$1,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$4,0)):INDEX('[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$201,MATCH($E8,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$J$201,0),163))=0,COLUMN(INDEX($J$4:$FP$4,1,MATCH($BB$1,'[Leave  allocation 2011 MasterTrial.xls]Leave Approved'!$J$4:$FP$4,0)):$FP$4)-1,FALSE))))

It is working.
Is it possible to shorten it a bit?
Asad
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,522
Members
452,923
Latest member
JackiG

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