Desperate for Formula Help

asad

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

I got the following:
Excel Workbook
ABCDEFG
4ShiftName
5A/LRDO
6AM GROUP RED
701DF034MATAU
8A/L2DF042REEVE#REF!
9A/L3DF044ROZEA/L 15/05/11
1004DF066SAMBEVSKI
1105DF046SANDOVAL
1206DF048SEBASTIAN
1307DF086SHEN
1408DF051SIMBORO
1509DF112SIPILIANO
16010DF055SUNTOVSKI
17011DF056TAPIA
18012DF089TUSITALA
19013DF083VITALE
20014DF059VUU
Weekly Roster


I have not been able to get this to give me the desired result which should be
HTML:
A/L 15/05/2011
.

Can somebody please tell me what's wrong with my formula?

Asad
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,

Rather than posting a formula that isn't returning the correct result and expecting us to try to decipher what's going on with it, much better to clearly explain what you want the formula to deliver given the sample data provided.

Could you do this so that we can try to help?

Matty
 
Upvote 0
Thanks for responding so quick.

I am trying to work out the last date for an employee to be on the annual leave.
Column A in my file got a formula that checks whether that particular employee is on leave for the current week that the roster is for or not. If yes, it puts A/L so show annual leave.

The cell with employee name in column F will become yellow if that person is on leave for this week.

Column G at the moment is filled manually. I want it to look in the same file as column A is looking. That is the file that contains information regarding employees being on annual leave or not and just to make it clear, I will post a screen shot of the portion from that file.
Excel Workbook
ABCDEFGHIJKLMNOP
22000>800>Name2010
31750>600>28-Dec4-Jan11-Jan18-Jan25-Jan
41500>500>3-Jan10-Jan17-Jan24-Jan31-Jan
5123456
61250>400>8627344Both Depots Total4546444217
71000>300>Sandringham Total45542
8Balance + or - on Leave#REF!#REF!#REF!#REF!#REF!
9Sep-107706702Footscray on LeaveTotal4141393815
103972412AM Drivers on Leave222220208
11982500Relief Drivers on Leave11100
12Balance + or - on Leave#REF!#REF!#REF!#REF!
132751790PM Drivers on Leave181818187
1492642Sandringham Total45542
15172:10376:57549:07435:075301DF002ADDICOTT, Steven Charles - Code: DF002 - Family Name: ADDICOTTADDICOTT
16218:380:00218:38142:384302DF078AGGETT, Brian Charles - Code: DF078 - Family Name: AGGETTAGGETT
17112:260:00112:26112:264403DF125ANTONOVICH, Glen Anthony - Code: DF125 - Family Name: ANTONOVICHANTONOVICH1
18573:40149:15722:55266:5551624DF021ARDON, MoisesARDON1111
19151:42224:15375:57337:5712205DF004BACH, Hung Tan - Code: DF004 - Family Name: BACHBACH. R
Leave Approved


In this file, 1 in a cell in any employee's row means he/she is on leave for that week. The dates in rows 3 and 4 are week starting and week ending dates. My formula looks at the week ending date.

I hope I haven't confused you guys. Please let me know if oyu need any more information. Thanks for your help.

Asad
 
Upvote 0
One more thing I wanted to ask you. When I put path of file in the formula, do I have to put in full path as shown in my first post even if both files are in same folder or just the folder name and the file name would fix it?
 
Upvote 0
I think, if I could use the following formula, it would work.
index('[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4,1,min(if(len(INDEX('[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$201,MATCH($F10,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$K$201,0),MATCH($BC$1,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4,0)):INDEX('[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$201,MATCH($F10,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$K$201,0),MATCH(LOOKUP(TODAY()+1000,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4),'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4,0))=0,column(INDEX('[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$201,MATCH($F10,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$K$201,0),MATCH($BC$1,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4,0)):INDEX('[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$201,MATCH($F10,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$K$201,0),MATCH(LOOKUP(TODAY()+1000,'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4),'[Leave allocation 2011 MasterTrial.xls]Leave Approved'!$K$4:$FP$4,0))))

But when I try to put it in, I get the message the formula is too long and deletes everything. :(

I don't know what to do?:confused:
 
Last edited:
Upvote 0
I am still struggling to understand I'm afraid.

In your original post, you reference the name 'REEVE', but I can't see this name in the second table you posted.

Moreover, could you explain what criteria needs to met on the 'Leave Approved' Worksheet in order for 'A/L 15/05/11' to be the result in the 'Weekly Roster' Worksheet?

Matty
 
Upvote 0
I am still struggling to understand I'm afraid.

In your original post, you reference the name 'REEVE', but I can't see this name in the second table you posted.

Moreover, could you explain what criteria needs to met on the 'Leave Approved' Worksheet in order for 'A/L 15/05/11' to be the result in the 'Weekly Roster' Worksheet?

Matty

The reason you can't see REEVE in the second table is that the woksheet is a very big one. I don't want to post the whole sheet here as it will take up lots and lots of room. But the name is definitely there in the top middle section of that list of names.
The criteria is simple. If REEVE was on leave from 2nd May to 15th May, I want the formula to find the last date of his leave and show that date in the cell as "A/L 15/05/2011" and if he was to be on leave untill 5th June, the cell will display "A/L 05/06/2011". The last date of leave will always be a Sunday as the annual leave are approved for whole weeks starting Mondays and ending Sundays.
I posted the second table just to show how we enter an employee's annual leave for any particular week.If the column for any week shows 1, then that means that the employee in that row is on leave for that week.

Please let me know if you want me to post a shot of the portion where "REEVE" name is written.

Thanks for your help. Asad
 
Upvote 0
Is it just the last leave you're interested in?

If so, and using the data you've posted for testing purposes, try:

Weekly Roster

<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:29px;"><col style="width:34px;"><col style="width:67px;"><col style="width:64px;"><col style="width:48px;"><col style="width:64px;"><col style="width:97px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td> </td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td><td>G</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td><td rowspan="2" style="font-family:Verdana; font-size:8pt; text-align:center; ">Shift</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td><td rowspan="2" style="font-family:Verdana; font-size:8pt; text-align:center; ">Name</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">A/L</td><td style="font-family:Verdana; font-size:8pt; ">RDO</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">6</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-style:italic; font-family:Verdana; font-size:8pt; text-align:left; ">AM GROUP RED</td><td style="font-style:italic; font-family:Verdana; font-size:8pt; "> </td><td style="font-style:italic; font-family:Verdana; font-size:8pt; "> </td><td style="font-style:italic; font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">7</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">A/L</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">1</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF021</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">ARDON</td><td style="font-family:Verdana; font-size:8pt; ">A/L 24/01/2011</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">8</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">2</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF042</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">REEVE</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">9</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">3</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF044</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">ROZE</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">10</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">4</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF066</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SAMBEVSKI</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">11</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">5</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF046</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SANDOVAL</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">12</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">6</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF048</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SEBASTIAN</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">13</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">7</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF086</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SHEN</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">14</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">8</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF051</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SIMBORO</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">15</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">9</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF112</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SIPILIANO</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">16</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">10</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF055</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">SUNTOVSKI</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">17</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">11</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF056</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">TAPIA</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">18</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">12</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF089</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">TUSITALA</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">19</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">13</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF083</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">VITALE</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">20</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">0</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; text-align:right; ">14</td><td style="font-family:Verdana; font-size:8pt; "> </td><td style="font-family:Verdana; font-size:8pt; ">DF059</td><td style="font-family:Verdana; font-size:8pt; text-align:left; ">VUU</td><td style="font-family:Verdana; font-size:8pt; "> </td></tr></tbody></table>
The formula in G7 is:

Code:
=IF(A7<>A$5,"",A7&" "&TEXT(MAX(IF('Leave Approved'!I$15:I$19=E7,IF('Leave Approved'!$L$15:$P$19=1,'Leave Approved'!$L$4:$P$4))),"dd/mm/yyyy"))

Which requires array entry, i.e. CTRL+SHIFT+ENTER.

If I'm off the mark here, please explain further.

Matty
http://www.excel-jeanie-html.de/index.php?f=1
 
Upvote 0
Thanks a lot Matty for your help.
I had to tweak this a bit, but finally it worked.
Thanks again.
Asad
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

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