Dates formula

O

orquidea

Hi

I want to deduct 2 dates. I also want to deduct weekend days if they are
within the period of time of the calculation. e.i

10/23/07 - 10/18/07 = 5 days minus 2 weekend days = 3 days

I want to get 3 days result.

Could someone help with this formula please.

Thanks
Orquidea
 
C

Carlo

Hi Orquidea

try this formula

=((A1-A2-WEEKDAY(A1)+WEEKDAY(A2)-7)/7*5)+WEEKDAY(A1)-WEEKDAY(A2)+5

where A1 is the later date.

hth

Carlo
 
C

cubbybear3

Take a look at the help on the NETWORKDAYS function. It will give you
the difference between 2 dates. It will exclude weekends and allow
you to have a 'range of holidays' to exclude as well. -pb
 
R

Roger Govier

Hi

With 10/23/07 in A1 and 18/10/07 in B1
=NETWORKDAYS(B1,A1)-1
You need to deduct 1 if you want a result of 3, as Networkdays includes the
whole of the first and last days.

Networkdays is part of the Analysis Toolpak.
Tools>Addins>check Analysis Toolpak
 
O

orquidea

Thanks Carlo

Carlo said:
Hi Orquidea

try this formula

=((A1-A2-WEEKDAY(A1)+WEEKDAY(A2)-7)/7*5)+WEEKDAY(A1)-WEEKDAY(A2)+5

where A1 is the later date.

hth

Carlo
 
O

orquidea

Thanks Roger. It worked.

Roger Govier said:
Hi

With 10/23/07 in A1 and 18/10/07 in B1
=NETWORKDAYS(B1,A1)-1
You need to deduct 1 if you want a result of 3, as Networkdays includes the
whole of the first and last days.

Networkdays is part of the Analysis Toolpak.
Tools>Addins>check Analysis Toolpak
 

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