ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   using IF & AND in formula (https://www.excelbanter.com/excel-worksheet-functions/108338-using-if-formula.html)

Latsh

using IF & AND in formula
 
Hi.
I'm using Excel 2000, in simple terms, I need a formula for the following.
I'm working with numbers.

IF A2 is GREATER than B2, then A2+B2
OR
IF A2 is LESS than B2, then B2-A2

Thanks,
Latsh NJ

Joe_Germany

using IF & AND in formula
 
here it is..

=IF(A2B2,A2+B2,IF(A2<B2,B2-A2))

Joe

Latsh wrote:
Hi.
I'm using Excel 2000, in simple terms, I need a formula for the following.
I'm working with numbers.

IF A2 is GREATER than B2, then A2+B2
OR
IF A2 is LESS than B2, then B2-A2

Thanks,
Latsh NJ



Mark K.

using IF & AND in formula
 

=If(A2B2,A2+B2,B2-A2)


Latsh wrote:
Hi.
I'm using Excel 2000, in simple terms, I need a formula for the following.
I'm working with numbers.

IF A2 is GREATER than B2, then A2+B2
OR
IF A2 is LESS than B2, then B2-A2

Thanks,
Latsh NJ


RagDyeR

using IF & AND in formula
 
What happens if A2=B2?
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Latsh" wrote in message
...
Hi.
I'm using Excel 2000, in simple terms, I need a formula for the following.
I'm working with numbers.

IF A2 is GREATER than B2, then A2+B2
OR
IF A2 is LESS than B2, then B2-A2

Thanks,
Latsh NJ



Joe_Germany

using IF & AND in formula
 
Mark:
he wants B2-A2 not when A2=B2..

Mark K. wrote:
=If(A2B2,A2+B2,B2-A2)


Latsh wrote:
Hi.
I'm using Excel 2000, in simple terms, I need a formula for the following.
I'm working with numbers.

IF A2 is GREATER than B2, then A2+B2
OR
IF A2 is LESS than B2, then B2-A2

Thanks,
Latsh NJ



daddylonglegs

using IF & AND in formula
 
Perhaps

=B2+SIGN(A2-B2)*A2




All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com