ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel Workday Function (https://www.excelbanter.com/excel-worksheet-functions/127226-excel-workday-function.html)

Leigh

Excel Workday Function
 
I'm trying to use the "WORKDAY" function in Excel 2003 to calculate a date,
from a given date, after a number of workdays. I can't seem to get it to
work like it should. When I type my cell references into the formula I keep
getting a NAME! error. I've even tried the tutorials provided here online
but those haven't worked either. Any suggestions?

Ron Rosenfeld

Excel Workday Function
 
On Mon, 22 Jan 2007 13:26:02 -0800, Leigh
wrote:

I'm trying to use the "WORKDAY" function in Excel 2003 to calculate a date,
from a given date, after a number of workdays. I can't seem to get it to
work like it should. When I type my cell references into the formula I keep
getting a NAME! error. I've even tried the tutorials provided here online
but those haven't worked either. Any suggestions?



From HELP for the Workday Function:


If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.

How?

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron

theSquirrel

Excel Workday Function
 

I tend not to rely on the Analysis Add-In because if the user doesn't
have that installed, all they will see is an error.

I found this gem somewhere online and use it anytime I need a workdays
calculation.

'@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@ #@
Function GetWorkDays(StartDate As Date, EndDate As Date) As Long
' returns the count of days between StartDate - EndDate minus
Saturdays and Sundays
' to call this from a procedure use the following syntax
' GetWorkDays (Date1, Date2)

Dim d As Long, dCount As Long
For d = StartDate To EndDate
If Weekday(d, vbMonday) < 6 Then
dCount = dCount + 1
End If
Next d
GetWorkDays = dCount
End Function
'@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@ #@

You need to keep in mind that it doesn't take holidays in to account,
but has never been wrong in my uses.

good luck.

theSquirrel


On Jan 22, 1:26 pm, Leigh wrote:
I'm trying to use the "WORKDAY" function in Excel 2003 to calculate a date,
from a given date, after a number of workdays. I can't seem to get it to
work like it should. When I type my cell references into the formula I keep
getting a NAME! error. I've even tried the tutorials provided here online
but those haven't worked either. Any suggestions?




All times are GMT +1. The time now is 10:48 PM.

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