IF(AND(OR multi step fx help needed

brose99

New Member
Joined
Jun 16, 2018
Messages
29
ABC
123-1451
2-71140
3351301
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!
 

sadboy309

Board Regular
Joined
Oct 15, 2014
Messages
88
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
Joined
Dec 3, 2018
Messages
8,819
Office Version
2007
Platform
Windows
How about:



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

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
8,819
Office Version
2007
Platform
Windows
I'm glad to help you. Thanks for the feedback.
 

brose99

New Member
Joined
Jun 16, 2018
Messages
29
I'm glad to help you. Thanks for the feedback.
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
Joined
Dec 3, 2018
Messages
8,819
Office Version
2007
Platform
Windows
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
Joined
Jun 16, 2018
Messages
29
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
Joined
Dec 3, 2018
Messages
8,819
Office Version
2007
Platform
Windows
>=175 in A1, but in B1 you must have > =- 150 and < 109 ...
 

brose99

New Member
Joined
Jun 16, 2018
Messages
29
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:
ABC
1-145231
214071
3130351
4-127-22




<tbody>
</tbody>
 

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top