Networkdays (working hours formula now to include holidays)

N

nigeo

I am using a formula
=((NETWORKDAYS(C2,I2)-1)*(Z$2-Y$2)+IF(NETWORKDAYS(I2,I2),MEDIAN(MOD(I2,1),Z$2,Y$2),Z$2)-MEDIAN(NETWORKDAYS(C2,C2)*MOD(C2,1),Z$2,Y$2))

this gives me working hours Mon-Fri (Y and Z = start and finish times)

now I need to incorporate bank holidays please can you advise what i need to
do to the above formula
 
F

Fred Smith

Help on Networkdays has your answer. You create a range of your holidays,
then tell the function where it is, as in:
=((Networkdays(c2,i2,x1:x10)...

Regards, Fred
 
D

David Biddulph

If you look in Excel help for the NETWORKDAYS formula, it will tell you
where to include your list of holidays in the syntax.
 
V

Victor Delta

nigeo said:
I am using a formula
=((NETWORKDAYS(C2,I2)-1)*(Z$2-Y$2)+IF(NETWORKDAYS(I2,I2),MEDIAN(MOD(I2,1),Z$2,Y$2),Z$2)-MEDIAN(NETWORKDAYS(C2,C2)*MOD(C2,1),Z$2,Y$2))

this gives me working hours Mon-Fri (Y and Z = start and finish times)

now I need to incorporate bank holidays please can you advise what i need
to
do to the above formula

Networkdays has a third, and optional, part to its syntax:

NETWORKDAYS(start_date,end_date,holidays)

Simply enter the dates of bank holidays in an area on the spreadsheet - say
A1:A12 and then add this to your formula.

HTH

V
 
S

Shane Devenshire

Hi,

NETWORKDAYS(StartDate,EndDate,Holidays)

Holidays being a range listing all the holidays as dates.

However, I don't follow how this formula does what you say you want. I
might be more useful if you showed us a sample of the data and told us what
you wanted from it. For example NETWORKDAYS(C2,C2) will always return 1 if
there is anything in C2, so why not just substitue 1? Or if necessary
IF(C2,1).
 
N

nigeo

Sorry Shane the formula does give me what i want, not sure why, was given
formula on this discussion site, I am now sorted with the holiday thing as
well.

Regards
 

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