Subtracting Dates with Empty Cells

W

Workbook

I am using this formula to figure out how many days are between two dates
without including the weekends.
=NETWORKDAYS(J15,K15)-(WEEKDAY(J15,2)<6)+(1-MOD(3,1))*(WEEKDAY(J15,2)<6)+(MOD(K15,1)-1)*(WEEKDAY(K15,2)<6). I have placed this formula in cell N15.

It works very well, however in cell N15 the columns I am subtracting (cell
J15 and column K15) are missing dates. Could you tell me what I could
include in this formula so that it does not work when a cell in column J
and/or column K is missing a date? What I would like to happen instead is
for cell N15 (which contains the formula) to be blank or contain a zero
inside of it, when dates are missing from J15 and/or K15. Is this possible?
 
T

T. Valko

Add this to the beginning of the formula:

=IF(COUNT(J15:K15)<2,0,

And add a closing ")" to the very end of the formula
 
T

T. Valko

=IF(COUNT(J15:K15)<2,
=IF(COUNT(J15:K15)<>2,

There is essentially no difference between the 2 of those expressions.

I see at the end of the formula you have:

......)<6).")"

It should be:

......)<6))

About that message, I would just ignore it. I have all those error checking
messages turned off.
 
W

Workbook

Thanks Man. I must be typing something incorrectly. However, I am having
success with this formula =IF(COUNT(K15:L15)<>2,"",NETWORKDAYS(K15,L15)-1),
so I'll probably stick with it. Thank you again for your input!
 

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