IF Statement that Returns Multiple Results

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

Is it possible to place a formula in A1 that returns
different "Codes" depending on:

IF P1=Q1 Returns "Lock"
IF P1>Q1 Returns "Cross"
If G1="Sell" and P1=0 Returns "NA"
If G1="Buy" and Q1=0 Returns "NA"

Thank you in advance.
 
Hi Carl

this is an IF statement based on your criteria

=IF(P1=Q1,"Lock",IF(P1>Q1,"Cross",IF(AND(G1="SELL",P1=0),"NA",IF(AND(G1="Buy
",Q1=0),"NA",""))))

Cheers
JulieD
 
Thanks Julie.

I tried to add the following condition:

If P1=0 and Q1=0 Return "Zero"

But could not get it to work.

Could you show me how to add another condition ?
 
Hi
try
=IF(P1=Q1,IF(P1=0,"Zero","Lock",IF(P1>Q1,"Cross",IF(AND(G1="SELL",P1=0)
,"NA",IF(AND(G1="Buy
",Q1=0),"NA","")))))
 
Thank you Frank. When I tried this excel tells me that I
have entered to many arguments ?

Can you advise please.
 
Hi
sorry, my fault. make this:
=IF(P1=Q1,IF(P1=0,"Zero","Lock"),IF(P1>Q1,"Cross",IF(AND(G1="SELL",P1=0
)
,"NA",IF(AND(G1="Buy",Q1=0),"NA",""))))
 
Back
Top