PDA

View Full Version : Workday Friday changed to a Thursday



tammyl
11-11-2014, 06:32 PM
Hi,
Hoping someone can assist. i know that i can test if a workday = 6 (Friday) and then do a if (a1)=6,workday(a1)-1,(a1)
To calculate the date (a1) i already have a big formula to take into consideration matching dates and text in a table & holdiays.
I used workday.intl to tell workdays are only Monday to Thursday "0000111".
This worked well except is pushes the Friday to the following Monday.

I need the workday.intl to push the Friday to the earlier Thursday, that is -1...only if the day falls on a Friday.

Can workday.intl do this or do i need to use the full if, then, else formula.

I was trying to keep my formula as simple & short as possible so others could maintain updates.

Any help much appreciated.

Tammy

Aussiebear
11-11-2014, 08:47 PM
Just to clarify Tammy, do you now have a 4 day working week starting Mondays & ending Thursdays?

tammyl
11-13-2014, 03:15 AM
Hi Aussiebear,
Yes workdays only Monday thru to Thursday.
Cheers Tam

Aussiebear
11-13-2014, 08:48 PM
Sorry for the delay in assisting you here but I'm struggling with my eyes at the moment. Have a read of Chip Pearson's website "A better workday function" section as I think this may assist you.

tammyl
11-18-2014, 05:19 PM
HI, the function looks very suitable except i get a compile error = User-Defined type not defined in the VBA code and it highlights the first line "Function Workday2(startdate as date.....

i don't quite know how to debug this so will keep on having a look.
Thankyou for the link and your help.

OK, i got it debugged and now the function returns a date...but .. it returns a date on one of my excluded days.
Example:
=Workday2(date(2014,11,15),0,(32 + 64 + 1),Holidays)
Startdate is 15/11/2014 if this is a Friday, Saturday or Sunday as in my original post i need it to select the earlier Thursday.
The Workday2 function returned 15/11/2014.

Any ideas..