Excluding Negative Numbers

W

Workbook

Thanks mostly to T. Valko and JE McGimpsey I have the following formulas.

1) =IF(COUNT(K15:L15)<>2,"",NETWORKDAYS(K15,L715)-1)

2) =IF(N15<>"",(N15*24),"")

Both formulas makes the cell which contains the formula blank when data is
missing from one of the two referenced cells. As a result some kind of error
message will not appear and the cell stays blank allowing for accurate
calculations of other formulas.

Do you know how the formulas above could be modified to exclude negative
numbers as well, so that the cells which contain these formulas go blank when
they calculate a negative number?
 
M

muddan madhu

may be this

=IF(SIGN(IF(COUNT(K15:L15)<>2,"",NETWORKDAYS(K15,L15)-1))=-1,"",IF
(COUNT(K15:L15)<>2,"",NETWORKDAYS(K15,L15)-1))
 
W

Workbook

It works as long as I have two dates, to subtract, but sometimes I am missing
a date. Do you know if it's possible to combine this formula
=IF(COUNT(K15:L15)<>2,"",NETWORKDAYS(K15,L715)-1) with your formula so that
if dates are missing, the cell this formula is in will go blank? or if the
number that would appear in the cell is negative it will go blank?
 
X

xlmate

This assume that if K15 and L15 is not = 2 or that they are negative number,
the formula will return a blank.

=IF(OR(COUNT(K15:L15)<>2,(COUNT(K15:L15)<0)),"",NETWORKDAYS(K15,L15)-1)

Is this what you want?
HTH
--
Pls provide your feedback by clicking the Yes button below if this post have
help you. This will help others to search the archives for result better.


Thank You

cheers, francis
 
X

xlmate

Hi,

apology,

this formula will return blank based on your additional requirement
over your existing formula

=IF(OR(COUNT(K15:L15)<>2,L15-K15<0),"",NETWORKDAYS(K15,L15)-1)

HTH
--
Pls provide your feedback by clicking the Yes button below if this post have
help you. This will help others to search the archives for result better.


Thank You

cheers, francis
 
W

Workbook

Mike, you're the man. It works! I have been trying so hard to get this.
Thank you!
 
W

Workbook

Sorry Francis, I have been up all night. I was writing messages to you and
Mike at the same time. You were right it works. I cannot thank you enough.

Ed
 

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