#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default IF statements

how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is greater
than zero, otherwise 0.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default IF statements

=IF(A1+B1<0,IF(A10,A1,IF(B10,B1,0)),0)

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"profmorse" wrote in message
...
how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is
greater
than zero, otherwise 0.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default IF statements

Another solution
=if(a+b<0,max(a,0),max(b,0))

"profmorse" wrote:

how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is greater
than zero, otherwise 0.

  #4   Report Post  
Junior Member
 
Posts: 27
Cool

profmorse

=--IF(and(A1+B1<0,MAX(A1:B1)0),MAX(A1:B1))

happy holidays hohoho..:)
romelsb @ banter

Quote:
Originally Posted by Brad
Another solution
=if(a+b<0,max(a,0),max(b,0))

"profmorse" wrote:

how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is greater
than zero, otherwise 0.
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default IF statements

Just another option,

=((A1+B1)<0)*MAX(A1,B1,0)
--
HTH

Sandy
Retired for Work
But hopefully not from Life


with @tiscali.co.uk


"profmorse" wrote in message
...
how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is
greater
than zero, otherwise 0.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default IF statements

Yes, that would work just as well - both a1 and b1 cannot be positive and
meet the first condition - and if both of them are negative you will still
get zero as an answer


"Sandy Mann" wrote:

Just another option,

=((A1+B1)<0)*MAX(A1,B1,0)
--
HTH

Sandy
Retired for Work
But hopefully not from Life


with @tiscali.co.uk


"profmorse" wrote in message
...
how can I build an If statement that answers the following; If A+B<0 then
chose A only if A is greater than 0, otherwise chose B, only if B is
greater
than zero, otherwise 0.




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
Multiple IF statements or a better method ? Bob Moore Excel Discussion (Misc queries) 4 November 25th 06 01:20 AM
2 IF Statements not mutually exclusive Bev Excel Discussion (Misc queries) 2 August 24th 06 05:23 AM
UDFunctions and nested If-the-else statements JDB Excel Worksheet Functions 1 January 25th 06 03:29 PM
Linking two IF statements together trixma Excel Discussion (Misc queries) 2 September 29th 05 06:07 AM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM


All times are GMT +1. The time now is 06:55 AM.

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

About Us

"It's about Microsoft Excel"