Microsoft KB Archive/99021

= Microsoft Knowledge Base =

Excel: WORKDAY Function Returns Incorrect Result
Last reviewed: September 12, 1996

Article ID: Q99021

The information in this article applies to:


 * Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
 * Microsoft Excel for the Macintosh, versions 4.0, 5.0

SUMMARY
If you are using the WORKDAY function, and the value for the days argument is not an integer and is negative, the function will round the value rather than truncate it. The result of this function will be incorrect.

MORE INFORMATION
The WORKDAY function returns a date before or after the start date for a specified number of workdays. The days parameter can be either positive (days earlier than the start_date) or negative (days later than the start_date). If you use a negative noninteger for the days argument, you will receive an incorrect date, because Microsoft Excel rounds the day parameter instead of truncating it. Positive noninteger numbers are truncated correctly.

For example, if you enter the following formula in cell A1

=WORKDAY(DATEVALUE(&quot;4/7/93&quot;),1.2) you will receive the following result:

Thursday, April 8, 1993 This result is correct: the date is 1 working day after 4/7/93. However, if you enter the following formula in cell A2

=WORKDAY(DATEVALUE(&quot;4/7/93&quot;),-1.2) you will receive the following result:

Monday, April 5, 1993 This result is incorrect. The number of negative days should have been truncated to -1 to return the date Tuesday, April 6, 1993.