View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GJones GJones is offline
external usenet poster
 
Posts: 132
Default How to subtract weekend days?

Hi simsjr;

Pasted below is the VBA help for the WeekDay method. As
long as your worksheet has the dates for each day you
should be able to use the method to add up the weekdays
instead of minusing the weekend days out.


WeekdayName Function


Description

Returns a string indicating the specified day of the week.

Syntax

WeekdayName(weekday, abbreviate, firstdayofweek)

The WeekdayName function syntax has these parts:

Part Description
weekday Required. The numeric designation for the day of
the week. Numeric value of each day depends on setting of
the firstdayofweek setting.
abbreviate Optional. Boolean value that indicates if the
weekday name is to be abbreviated. If omitted, the default
is False, which means that the weekday name is not
abbreviated.
firstdayofweek Optional. Numeric value indicating the
first day of the week. See Settings section for values.



Settings

The firstdayofweek argument can have the following values:

Constant Value Description
vbUseSystem 0 Use National Language Support (NLS) API
setting.
vbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday



Thanks,

Greg
-----Original Message-----
Hi,

I'd like to know if there's a way to make Excel subtract

weekend days when
calculating actual workdays.

For example, I have cells for the start date and end date

of a sales
forecast. Let's say it's for three weeks (21 days). Now,

what I'd like to do
is subtract the weekend days (there are 6 in this period)

to get the "15".

Now, if I was only doing a forecast for three weeks at a

time, I could just
have Excel subtract the 6 weekend days with a simple

subtraction formula.
However, we want this report to scale to any time period

and subtract any
weekend days that occur in that period.

Make sense? Is there a way to do this? I have Excel 97 if

that means anything.
.