# IF(AND(OR multi step fx help needed

#### brose99

##### New Member
 A B C 1 23 -145 1 2 -71 140 3 35 130 1 4 -22 -127

<tbody>
</tbody>

How do you write a proper IF(AND(OR fx in cell C1 that I can drag down thru C4 that states:
if the number in cell A1 is >0 and <50 AND
the number in cell B1 is >-150, <-109 *OR* >109, <150,
then cells C1 populates a 1 if it does, and a "" if it doesn't?

I hope I explained that ok.

The final results should have a 1 in C1 and a 1 in C3

Thanks in advance for any help!

##### Board Regular
Bạn thử công thức:
=IF(A1="","", ((A1> 0) * (A1 <50)) * ((B1> -150) * (B1 <-109) + (B1> 109) * (B1 <150)))

Last edited:

#### DanteAmor

##### Well-known Member

=IF(AND(A1>0,A1<50,OR(AND(B1>-150,B1<-109),AND(B1>109,B1<150))),1,"")

#### brose99

##### New Member

=IF(AND(A1>0,A1<50,OR(AND(B1>-150,B1<-109),AND(B1>109,B1<150))),1,"")
NAILED IT! Gracias, DanteAmor! Much appreciated, amigo!

#### brose99

##### New Member
Quick updated question, Dante...

I need to update the first portion of the above IF(OR(AND fx so that it also includes all numbers greater than or equal to 175. For example: A1>0, A1<50 OR A1>=175

The 2nd portion of the formula *...OR(AND(B1>-150,B1<-109),AND(B1>109,B1<150))),1,"") * will remain the same.

I've tried tinkering with the first part of this fx to make this adjustment and I keep messing it up. I know it's a simple fix for someone much better than me. Can you, or anyone else, assist me with this, please?

Thanks!

#### DanteAmor

##### Well-known Member
Try:

=IF(AND(OR(AND(A1>0,A1<50),A1>=175),OR(AND(B1>-150,B1<-109),AND(B1>109,B1<150))),1,"")

#### brose99

##### New Member
Try:

=IF(AND(OR(AND(A1>0,A1<50),A1>=175),OR(AND(B1>-150,B1<-109),AND(B1>109,B1<150))),1,"")
The formula looks right, and it doesn't give me an error message when I type it in, but it's still not picking up any number >=175 in A1. Hmmmm.....

#### DanteAmor

##### Well-known Member
>=175 in A1, but in B1 you must have > =- 150 and < 109 ...

#### brose99

##### New Member
Still having the same issues. I double checked my work and its typed in correctly.

Does it matter which IF(AND(OR fx comes first? Because due to formatting issues, I had to flip/flop columns A&B from my original message. The new data set looks like this:
 A B C 1 -145 23 1 2 140 71 3 130 35 1 4 -127 -22

<tbody>
</tbody>

1,081,984
Messages
5,362,556
Members
400,680
Latest member
Wild Child

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...