Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Networkdays function

Hi, I've been using the Networkdays function to work out the date 7 days
previous to today minus working days. I'm doing it in two stages, eg cell A1
= today(), cell A2 = 7, cell A3 = A1-A2, Cell A4 = Networkdays(A3, A1).
However, it comes back with the answer 6 when I would expect to see 5. Does
anyone know why that should happen? Also is there a quicker way of doing
this? Help would be much appreciated. Thanks. Jean
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Networkdays function

Hi,

I'm not surprised you get 6 because networkdays includes the start and end
date.

For example there are 5 network days between 1/1/2007 and 5/1/2007

so in your case going back 7 days from today takes us to 6/7/2007 which is
last Friday and Friday to Friday is 6 network days.

An easier way
=NETWORKDAYS(TODAY()-7,TODAY())

Mike



"jeanmac" wrote:

Hi, I've been using the Networkdays function to work out the date 7 days
previous to today minus working days. I'm doing it in two stages, eg cell A1
= today(), cell A2 = 7, cell A3 = A1-A2, Cell A4 = Networkdays(A3, A1).
However, it comes back with the answer 6 when I would expect to see 5. Does
anyone know why that should happen? Also is there a quicker way of doing
this? Help would be much appreciated. Thanks. Jean

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Networkdays function

If you want to exclude the start date us

=NETWORKDAYS(A3,A1)-(WEEKDAY(A3,2)<=5)

or

=NETWORKDAYS(A3,A1)-(WEEKDAY(A1,2)<=5)

to exclude the end date

The test is so as not to exclude if the day is a weekend as NETWORKDAYS
wouldn't have counted it anyway

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"jeanmac" wrote in message
...
Hi, I've been using the Networkdays function to work out the date 7 days
previous to today minus working days. I'm doing it in two stages, eg cell
A1
= today(), cell A2 = 7, cell A3 = A1-A2, Cell A4 = Networkdays(A3, A1).
However, it comes back with the answer 6 when I would expect to see 5.
Does
anyone know why that should happen? Also is there a quicker way of doing
this? Help would be much appreciated. Thanks. Jean



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Networkdays function

Thanks to both Mike and Bob for your help. I couldn't find anywhere that
Networkdays included the start and end date, it wasn't clear in the help.
Also thanks for the much better way of writing it.

Jean

"Bob Phillips" wrote:

If you want to exclude the start date us

=NETWORKDAYS(A3,A1)-(WEEKDAY(A3,2)<=5)

or

=NETWORKDAYS(A3,A1)-(WEEKDAY(A1,2)<=5)

to exclude the end date

The test is so as not to exclude if the day is a weekend as NETWORKDAYS
wouldn't have counted it anyway

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"jeanmac" wrote in message
...
Hi, I've been using the Networkdays function to work out the date 7 days
previous to today minus working days. I'm doing it in two stages, eg cell
A1
= today(), cell A2 = 7, cell A3 = A1-A2, Cell A4 = Networkdays(A3, A1).
However, it comes back with the answer 6 when I would expect to see 5.
Does
anyone know why that should happen? Also is there a quicker way of doing
this? Help would be much appreciated. Thanks. Jean




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NETWORKDAYS function Dave F[_2_] Excel Discussion (Misc queries) 1 July 7th 07 04:14 PM
NETWORKDAYS function kippers Excel Discussion (Misc queries) 2 June 19th 07 02:30 PM
Nesting Networkdays function inside and If function Addison Excel Worksheet Functions 2 April 13th 06 08:04 PM
Networkdays function Susan Hayes Excel Worksheet Functions 2 April 5th 05 06:59 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"