ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   27-May-2007 is a WORKDAY? (https://www.excelbanter.com/excel-worksheet-functions/144620-27-may-2007-workday.html)

[email protected]

27-May-2007 is a WORKDAY?
 
I'm using the following formula in local Excel 07 and Excel Web
Services, with the same unexpected results.

=WORKDAY(DATE(2007,5,27),0,holidays)

it returns the following.

27-May-2007

Sunday, May 27, 2007, is a workday? I think not.

It has worked fine, and still does, for a spread of dates before and
after, but just not on this one...any ideas?

-- MM


Rick Rothstein \(MVP - VB\)

27-May-2007 is a WORKDAY?
 
I'm using the following formula in local Excel 07 and Excel Web
Services, with the same unexpected results.

=WORKDAY(DATE(2007,5,27),0,holidays)

it returns the following.

27-May-2007

Sunday, May 27, 2007, is a workday? I think not.

It has worked fine, and still does, for a spread of dates before and
after, but just not on this one...any ideas?


It works the same way for May 20, 2007 too. The help files for this function
says...

"Returns a number that represents a date that is the
indicated number of working days before or after
a date (the starting date)."

Isn't the starting date exactly zero working days away from itself?
Basically, specifying zero days offset from a date gives you that date, no?
I mean, you are standing on a certain date and want to know the date will be
if you don't move from it.

Rick


Mike H

27-May-2007 is a WORKDAY?
 
The zero in your formula tells it to find the workday zero days after the
date specified so it is returning the date specified, Try it with a 1 and it
will return the next working day that doesn't appear in the range holiday.

Mike

" wrote:

I'm using the following formula in local Excel 07 and Excel Web
Services, with the same unexpected results.

=WORKDAY(DATE(2007,5,27),0,holidays)

it returns the following.

27-May-2007

Sunday, May 27, 2007, is a workday? I think not.

It has worked fine, and still does, for a spread of dates before and
after, but just not on this one...any ideas?

-- MM



Ron Coderre

27-May-2007 is a WORKDAY?
 
According to your formula you are looking to return the workday that is zero
days before/after the referenced date. In my version of Excel, that formula
always returns the referenced date (ignoring holidays completely).

If you're trying to determine if the referenced date is a holiday or weekend
try these:

=NETWORKDAYS(DATE(2007,5,27),DATE(2007,5,27),holid ays)=1
or
=AND(WEEKDAY(DATE(2007,5,27),2)<6,COUNTIF(holidays ,DATE(2007,5,27))=0)

(In that example, the formulas return FALSE)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


" wrote:

I'm using the following formula in local Excel 07 and Excel Web
Services, with the same unexpected results.

=WORKDAY(DATE(2007,5,27),0,holidays)

it returns the following.

27-May-2007

Sunday, May 27, 2007, is a workday? I think not.

It has worked fine, and still does, for a spread of dates before and
after, but just not on this one...any ideas?

-- MM



MM

27-May-2007 is a WORKDAY?
 
First, thanks for the various bits of advice.

I now understand that throwing the function a days=0 does give
unexpected results (at least to those of us working off the API). So
it pays to perform a check using IF(days=0)... and/or to begin an
increasing series at 1 instead of 0 or negative numbers.

I don't believe this behavior is published anywhere or maybe it's just
me. What gives?

-- MM



All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com