Thread: Returning Zero
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Shane Devenshire Shane Devenshire is offline
external usenet poster
 
Posts: 857
Default Returning Zero

Hi,

I need to correct the formula I just sent to read

=(A1-B1)*(A1*B1<0)

cheers,
Shane Devenshire

"captlb" wrote in message
...
thanks this is what i was looking for, very helpful

"Sloth" wrote:

I think I understand... You are using something like this formula

=MAX(A1-B1,0)

to return 0 or a positive number. But you want something that returns
zero
if either cell is empty (or equal to 0). Try this...

=(A1-B1)*(A1<0)*(B1<0)

"Silvercreek" wrote:

I use the MAX command for negative numbers when a positive number is
subtracted from zero or empty cells, returning a negative number, but
that
does not work when subtracting zero or empty cells from a positive
cell. Is
there a formula that will return a zero if either of the values in any
of the
cells being subtracted is empty or a formula that would cover both
situations?
Thanks
--
Silvercreek