IF(AND(OR multi step fx help needed

brose99

New Member
Joined
Jun 16, 2018
Messages
35
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]-145[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]-71[/TD]
[TD="align: center"]140[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]130[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]-22[/TD]
[TD="align: center"]-127[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

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!
 
Yep. That was it. I just figured it out.

When I switched the order of the columns, it threw off the original fx you shared with me. Once I flip flopped the two sections of the fx to compensate for this, the fx you gave me worked perfectly.

Thank you for your help, Dante. Very much appreciated, sir!
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Sorry Dante, I thought I fixed it, and I was wrong. Something is still not right.

I'm trying to post a picture of the worksheet I am working on so you can get a better scope of what I'm dealing with, but it won't let me upload a screenshot from my computer...
Screenshot%202019-04-27%2015.14.53.png
 
Upvote 0
I'm sorry I am having so much trouble with this.

Let's try this, Dante. Here is the updated problem I am having.



I am trying to write an fx in AL244 so that IF Z244 is >-150, Z244<-109 OR Z244 is >109, Z244<150 AND AB244 is >0.5, AB244<50 OR AB244>=175, then a 1 shows up in AL244. I not, then AL244 remains blank.

I hope I explained that ok.

Thanks in advance.
 
Upvote 0
I'm sorry I am having so much trouble with this.

Let's try this, Dante. Here is the updated problem I am having.



I am trying to write an fx in AL244 so that IF Z244 is >-150, Z244<-109 OR Z244 is >109, Z244<150 AND AB244 is >0.5, AB244<50 OR AB244>=175, then a 1 shows up in AL244. I not, then AL244 remains blank.

I hope I explained that ok.

Thanks in advance.

Can you put the formula?
In which cell is the formula that has the problem?
 
Upvote 0
Columns
......Z..........AB..........AJ

[TABLE="width: 155"]
<tbody>[TR]
[TD="class: xl67, width: 35, bgcolor: yellow, align: center"]136[/TD]
[TD="class: xl70, width: 35, align: center"]-5[/TD]
[TD="class: xl79, width: 35, bgcolor: red, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl69, bgcolor: yellow, align: center"]-146[/TD]
[TD="class: xl71, align: center"]10[/TD]
[TD="class: xl80, align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]

Here is the formula I am using in cell AJ236


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

The problem is that the results its producing are not accurate. Cell AB236 has -5 in it. -5 is out of the range I have specified in the above formula, yet in in cell AJ236 a 1 is populated when it shouldn't. I must have screwed something up and was hoping a second pair of eyes might help.

(I have highlighted the squares in red that have a "1" that should not have a "1" per the above formula.)
 
Last edited by a moderator:
Upvote 0
This happens

Z236 = 136


IF(OR

OR this (AND(Z236>-150,Z236<-109), FALSE

OR this AND
(Z236>109,Z236<150), TRUE

OR this AND
(OR(AND(AB236>0,AB236<50),AB236>=175))) FALSE

The second option is the one that is fulfilled, so come back 1.

----

This is my original formula


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

But if my formula does not work for you, then explain again what the conditions are.


---
In reference to cross posting, only apologize and add the link to this post and in this post add the link to your other page.
 
Upvote 0
Z236 >= 175
And
AB236 > 109,AB236 < 150

If Z236 = 180
AND
AB236 = 120

Return: 1

It works for me.
I dragdown and works.

If you modify my formula you must share it to revise it again.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-fo...ve-and-negative-number-range.html#post5108729

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top