View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
xlmate xlmate is offline
external usenet poster
 
Posts: 144
Default Excluding Negative Numbers

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)),"",NE TWORKDAYS(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


"Workbook" wrote:

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?

"muddan madhu" wrote:

may be this

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

On Feb 4, 12:42 pm, Workbook
wrote:
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?