PDA

View Full Version : Solved: WORKDAY in cell returning wrong Workday?



Dal1981
12-06-2011, 06:16 AM
Hi all,

Please can you help me understand my shortcomings in using the WORKDAY function in XL07....

I refer to "Now()" as a name range = 'IsToday'

Then, I wish to calculate the workingdays on from the 1st of the present month - so within the cell I use:

=DATE(YEAR(IsToday),MONTH(IsToday),1)

I have named this range as "THE1ST" (very inventive, I know)

Which all works fine.

Column D has the 'work day due' which is in just a number, ie - 2 = the second working day, so I fugured the below would work:

=WORKDAY(THE1ST,D2)

But say using this month, so my THE1ST = "01/12/2011" and my working day due is say "2" ...the above 'workday' function returns "5/12/2011" NOT the "2/12/2011" (Which was last Friday??!)

What am I over looking or why is this not working within my Excel??!

:dunno

Aflatoon
12-06-2011, 06:22 AM
It does not include the start date - it is the number of days after that.

Dal1981
12-06-2011, 06:30 AM
Thanks for speedy reply ... I don't grasp it though.

I wish to return the workday from the 1st of the current month (my 'The1st'). Is this not what WORKDAY performs, like adding x amount of days onto a given date and returning the correct weekday/workday?

I've seen some code on here that can build a function to do this, but really would be ideal to be within the worksheet itself....?

:doh:

Dal1981
12-06-2011, 06:31 AM
OH I SEE! It doesnt literally COUNT the start date - so I need to just add "-1" to my The1ST and then it works!!! Thats odd logic ... but it works!!!

Thanks... really was my thinking on that!

Dal1981
12-06-2011, 08:20 AM
Okay Xld, I get that. Should I build an nested If statement around if its a workday or not.. I'm trying to impliment the adding of 1 and don't know where to to ensure its correct ... I think adding an 'if' maybe the only option?

Bob Phillips
12-06-2011, 08:21 AM
I deleted that post as I was in cuckoo land, thinking of something else, so please ignore what you read.

Aflatoon
12-06-2011, 08:31 AM
Use D2-1 rather than D2.