ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Add two IF statements together (https://www.excelbanter.com/excel-worksheet-functions/30690-add-two-if-statements-together.html)

Dubbs

Add two IF statements together
 
I am trying to add these two together but can't get it to work.

=IF(AM11="Put"&AN11<$K$2;AN11-$K$2;$K$2-AN11)
=IF(AM11="Call"&AN11$K$2;$K$2-AN11;AN11-$K$2)



Myrna Larson

I assume by the ampersand you mean "AND". There's a function for that.
Ampersand concatenates text. Assuming AM11 will contain only Put or Call, and
no other values, and the result is to be negative for Puts and positive for
Calls,

=IF(AM11="Put",-ABS(AN11-$K$2),ABS(AN11-$K$2))

or

=ABS(AN11-$K$2)*IF(AM11="Put",-1,1)


On Tue, 14 Jun 2005 10:07:07 -0700, "Dubbs"
wrote:

I am trying to add these two together but can't get it to work.

=IF(AM11="Put"&AN11<$K$2;AN11-$K$2;$K$2-AN11)
=IF(AM11="Call"&AN11$K$2;$K$2-AN11;AN11-$K$2)



Dubbs

I am not sure why it shows my formulas like that. It should read

=IF(AM11="Put"&AN11<$K2$;AN11-$K$2;$K$2-AN11)

and

=IF(AM11="Call"&AN11$K$2;$K$2-AN11;AN11-$K$2)

"Dubbs" wrote:

I am trying to add these two together but can't get it to work.

=IF(AM11="Put"&AN11<$K$2;AN11-$K$2;$K$2-AN11)
=IF(AM11="Call"&AN11$K$2;$K$2-AN11;AN11-$K$2)




All times are GMT +1. The time now is 01:32 PM.

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