#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Returning Zero

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Returning Zero

=IF(OR(A12=0,B12=0),0,MAX(A12-B12,0))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Silvercreek" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Returning Zero

Not sure if I get the question but try =IF(OR(A1=0,B1=0),0,A1-B1)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Silvercreek" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 252
Default Returning Zero

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Returning Zero

This works for empty or zero cells, in Excel, that would return a positive
when subtracted from a positive cell, but not when positive cells are
subtracted from zero or empty. Can this be tweaked a bit?
Thanks for your help
--
Silvercreek


"Bob Phillips" wrote:

=IF(OR(A12=0,B12=0),0,MAX(A12-B12,0))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Silvercreek" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Returning Zero

This works for empty or zero cells, in Excel, that would return a positive
when subtracted from a positive cell, but not when positive cells are
subtracted from zero or empty. Can this be tweaked a bit?
Thanks for your help

--
Silvercreek


"Bernard Liengme" wrote:

Not sure if I get the question but try =IF(OR(A1=0,B1=0),0,A1-B1)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Silvercreek" wrote in message
...
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




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Returning Zero

I quote your original post ...

Is there a formula that will return a zero if either of the values in any of
the
cells being subtracted is empty

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Silvercreek" wrote in message
...
This works for empty or zero cells, in Excel, that would return a positive
when subtracted from a positive cell, but not when positive cells are
subtracted from zero or empty. Can this be tweaked a bit?
Thanks for your help
--
Silvercreek


"Bob Phillips" wrote:

=IF(OR(A12=0,B12=0),0,MAX(A12-B12,0))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Silvercreek" wrote in message
...
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






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Returning Zero

Your right, that's what I'm trying to do but the formula, unfortunately,
still doesn't work. Maybe I should explain in more detail. I was trying to
keep it simple but it doesn't seem like it's going to be that simple.
I'm working with dates.
Just for visualizations sake, I'm subtracting two cells to get the number
of days spent on a drawing on my project. I subtract the "start date" from
the "end date" and I get my answer. Simple. If the project isn't finished
but the drawing is then, of course, the "end date" for the project is empty.
If the "end date" is empty then "end date" minus "start date", (0-n), is less
than zero, that is handled with the MAX command, (thank you all very much).
But, if I enter "end date" with no "start date" (n-0), (which can happen in a
slightly different scenerio for me) then of course I will get a positive
return which is untrue.
The formulas I have been getting are helpfull but only work in one
situation or the other but not both. I have tried tweaking the formulas
being suggested but I haven't been able to make anything work. I hoper there
is something that will work.
Thanks for listening (reading).
--
Silvercreek


"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

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Returning Zero

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

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Returning Zero

Hi,

If the following formula is returning what you want:

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

then you might try this formula:

=(A1-B1)*(A1*B1)

If this helps, please click the Yes button

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




  #11   Report Post  
Posted to microsoft.public.excel.misc
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP returning value when range_lookup false jodieg Excel Worksheet Functions 6 August 24th 06 01:53 PM
My IF in Excel formula is not returning the correct value. Steph Excel Worksheet Functions 10 August 18th 06 06:29 PM
vlookup not returning full field value (text) JohnC Excel Worksheet Functions 0 June 27th 06 12:03 PM
LOOKUP returning value in cell above what I was searching for mwrfsu Excel Discussion (Misc queries) 2 September 10th 05 06:25 PM
MY VLOOKUP IS RETURNING N/A AND THEREFORE MY TOTAL SUM AT THE BOT. Martin Excel Discussion (Misc queries) 2 December 13th 04 11:21 AM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"