0

I'm trying to combine multiple IF statements and I can't get it to work. What it should do is the following:

If X=0 and Y>0, return 10000 OR if X>0 and Y=0, return -10000 if neither do nothing.

I have 2 columns with 7000 rows and I want to calculate the fold change between the 2. I am doing that by

=IF(CA2<1;-1/CA2;CA2)

so that 0.9 turns into -1.1. However if you have a value of 0 you get a #div/0! error. I was hoping to work around by giving single regulated values either a +10000 or -10000.

7
  • You just need to include an AND in your IF: =IF(AND(X="0",Y>"0"),"1000","0"),IF(AND(X>"0",Y="0"),"-1000","0") Commented Aug 16, 2017 at 11:26
  • I still get an error when trying this. Commented Aug 16, 2017 at 11:36
  • I'm putting the formula like this: =IF(AND(BW2="0",BX2>"0"),"1000","0"),IF(AND(BW2>"0",BX2="0"),"-1000"‌​,"0") where BW2 is a number (but the product of a formule, which is the average) Commented Aug 16, 2017 at 11:49
  • whats the error? Commented Aug 16, 2017 at 11:50
  • 1
    =IF(AND(BW2=0;BX2>0);10000;IF(AND(BW2>0;BX2=0);-10000;0)) This works, apparently , need to be ; Probably a setting issue. Thank you very much! Commented Aug 16, 2017 at 12:00

1 Answer 1

1

Your answer should be to include an AND in your if:

 =IF(AND(A2=0,B2>0),1000,IF(AND(A2>0,B2=0),-1000,0)) 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.