ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If with and (https://www.excelbanter.com/excel-discussion-misc-queries/104232-if.html)

Arne Hegefors

If with and
 
I want to write a simple formula. In column A and B I have values. In column
C I write my formula. I want to check if A and B anre not zero and if they
are both not zero I want to take A minus B. Now I tried writing it like this:

=IF((A22<0 & B22<0);A22-B22;"-")

It does not work. It taks A-B regardless of their values. Please help me
with this forumla!c Thanks alot!

Marcelo

If with and
 
Hi Arne,

=if(and(a1<0,b1<0),(a1-b1),0)

hth
regards from Brazil
Marcelo

"Arne Hegefors" escreveu:

I want to write a simple formula. In column A and B I have values. In column
C I write my formula. I want to check if A and B anre not zero and if they
are both not zero I want to take A minus B. Now I tried writing it like this:

=IF((A22<0 & B22<0);A22-B22;"-")

It does not work. It taks A-B regardless of their values. Please help me
with this forumla!c Thanks alot!


Alan

If with and
 
=IF(AND(A22<0,B22<0),A22-B22,"-")
Regards,
Alan.
"Arne Hegefors" wrote in message
...
I want to write a simple formula. In column A and B I have values. In
column
C I write my formula. I want to check if A and B anre not zero and if they
are both not zero I want to take A minus B. Now I tried writing it like
this:

=IF((A22<0 & B22<0);A22-B22;"-")

It does not work. It taks A-B regardless of their values. Please help me
with this forumla!c Thanks alot!




Harald Staff

If with and
 
Hi
=IF(AND(A22<0,B22<0);A22-B22;"-")
or
=IF((A22*B22)<0;A22-B22;"-")

HTH. Best wishes Harald

"Arne Hegefors" skrev i melding
...
I want to write a simple formula. In column A and B I have values. In
column
C I write my formula. I want to check if A and B anre not zero and if they
are both not zero I want to take A minus B. Now I tried writing it like
this:

=IF((A22<0 & B22<0);A22-B22;"-")

It does not work. It taks A-B regardless of their values. Please help me
with this forumla!c Thanks alot!





All times are GMT +1. The time now is 08:52 PM.

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