#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FJ FJ is offline
external usenet poster
 
Posts: 90
Default IF, OR, ISERROR?

Hi, Im trying to write a formula in column C. Basically, if the result of
A1-B1 is either a negative number or gives an error message, such as #VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I am
really stumped. :( I've tried many different combinations using IF, OR, and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF, OR, ISERROR?

=IF(ISERROR(A1-B1),0,MAX(0,A1-B1)) assuming that you might want it to show
A1-B1 in the cases for which you haven't specified an output.
or
=IF(ISERROR(A1-B1),0,IF(A1-B1<0,0,"whatever answer you want in this case"))
--
David Biddulph

FJ wrote:
Hi, I'm trying to write a formula in column C. Basically, if the
result of A1-B1 is either a negative number or gives an error
message, such as #VALUE, I want cell C1 to show 0. I realize this is
probably very simple, but I am really stumped. :( I've tried many
different combinations using IF, OR, and ISERROR but so far I haven't
had any success. :( Can anyone help?

Thank you in advance for any information.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF, OR, ISERROR?

Hi,

You didn't get around to telling us what was to happen if neither of these
conditions is TRUE so I guess a1-b1

=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)

Mike

"FJ" wrote:

Hi, Im trying to write a formula in column C. Basically, if the result of
A1-B1 is either a negative number or gives an error message, such as #VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I am
really stumped. :( I've tried many different combinations using IF, OR, and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FJ FJ is offline
external usenet poster
 
Posts: 90
Default IF, OR, ISERROR?

Hi, Mike, thank you so much for your quick reply. :) Your formula worked
great and yes, you were right that if neither condition were true I wanted
A1-B1. :)

Thanks again! :)




"Mike H" wrote:

Hi,

You didn't get around to telling us what was to happen if neither of these
conditions is TRUE so I guess a1-b1

=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)

Mike

"FJ" wrote:

Hi, Im trying to write a formula in column C. Basically, if the result of
A1-B1 is either a negative number or gives an error message, such as #VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I am
really stumped. :( I've tried many different combinations using IF, OR, and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default IF, OR, ISERROR?

"Mike H" wrote:
=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)


Or:

=IF(ISERRROR(A1-B1),0,MAX(0,A1-B1))

I'm not very familiar with Excel 2007, but I think that construction lends
itself well to the use of IFERROR, to wit:

=IFERROR(MAX(0,A1-B1),0)


----- original message -----

"Mike H" wrote in message
...
Hi,

You didn't get around to telling us what was to happen if neither of these
conditions is TRUE so I guess a1-b1

=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)

Mike

"FJ" wrote:

Hi, Im trying to write a formula in column C. Basically, if the result
of
A1-B1 is either a negative number or gives an error message, such as
#VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I
am
really stumped. :( I've tried many different combinations using IF, OR,
and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default IF, OR, ISERROR?

I wrote:
=IF(ISERRROR(A1-B1),0,MAX(0,A1-B1))


Oops! I didn't notice that David had already posted the same suggestion.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"Mike H" wrote:
=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)


Or:

=IF(ISERRROR(A1-B1),0,MAX(0,A1-B1))

I'm not very familiar with Excel 2007, but I think that construction lends
itself well to the use of IFERROR, to wit:

=IFERROR(MAX(0,A1-B1),0)


----- original message -----

"Mike H" wrote in message
...
Hi,

You didn't get around to telling us what was to happen if neither of
these
conditions is TRUE so I guess a1-b1

=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)

Mike

"FJ" wrote:

Hi, Im trying to write a formula in column C. Basically, if the result
of
A1-B1 is either a negative number or gives an error message, such as
#VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I
am
really stumped. :( I've tried many different combinations using IF, OR,
and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FJ FJ is offline
external usenet poster
 
Posts: 90
Default IF, OR, ISERROR?

Hi, Joe, sorry to respond so late. I haven't had a chance to check here in a
while. Thanks for your formulas. They worked great. :)



"Joe User" wrote:

"Mike H" wrote:
=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)


Or:

=IF(ISERRROR(A1-B1),0,MAX(0,A1-B1))

I'm not very familiar with Excel 2007, but I think that construction lends
itself well to the use of IFERROR, to wit:

=IFERROR(MAX(0,A1-B1),0)


----- original message -----

"Mike H" wrote in message
...
Hi,

You didn't get around to telling us what was to happen if neither of these
conditions is TRUE so I guess a1-b1

=IF(OR(ISERROR(A1-B1),A1-B1<0),0,A1-B1)

Mike

"FJ" wrote:

Hi, Im trying to write a formula in column C. Basically, if the result
of
A1-B1 is either a negative number or gives an error message, such as
#VALUE,
I want cell C1 to show 0. I realize this is probably very simple, but I
am
really stumped. :( I've tried many different combinations using IF, OR,
and
ISERROR but so far I haven't had any success. :( Can anyone help?

Thank you in advance for any information.


.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FJ FJ is offline
external usenet poster
 
Posts: 90
Default IF, OR, ISERROR?

Hi, David, sorry to respond so late. I haven't had a chance to check here in
a while. Thanks for your formulas. They worked great. :)


"David Biddulph" wrote:

=IF(ISERROR(A1-B1),0,MAX(0,A1-B1)) assuming that you might want it to show
A1-B1 in the cases for which you haven't specified an output.
or
=IF(ISERROR(A1-B1),0,IF(A1-B1<0,0,"whatever answer you want in this case"))
--
David Biddulph

FJ wrote:
Hi, I'm trying to write a formula in column C. Basically, if the
result of A1-B1 is either a negative number or gives an error
message, such as #VALUE, I want cell C1 to show 0. I realize this is
probably very simple, but I am really stumped. :( I've tried many
different combinations using IF, OR, and ISERROR but so far I haven't
had any success. :( Can anyone help?

Thank you in advance for any information.



.

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
iserror dnmusic Excel Worksheet Functions 4 October 15th 09 09:11 PM
Iserror help Jim Excel Discussion (Misc queries) 3 December 11th 08 09:11 PM
Help with ISERROR juliejg1 Excel Worksheet Functions 2 December 18th 07 01:22 AM
use of ISERROR NathanG Excel Worksheet Functions 8 January 24th 07 06:31 PM
iserror Walshy Excel Discussion (Misc queries) 3 December 19th 04 05:13 PM


All times are GMT +1. The time now is 07:45 PM.

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"