Networkdays function

J

jeanmac

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
 
M

Mike H

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
 
B

Bob Phillips

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)
 
A

aehan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top