How do i nested IF AND OR with unique values and unique message

AndyJR

Board Regular
Joined
Jun 20, 2015
Messages
90
Hi,

Cell E3 display dynamic reference values between 000 to 333 ( e.i 000,001,002,003, etc,etc)
Each reference have their "own" measure values that is displayed on cells
F3,G3,I3,R3,T3
for example :

Rich (BB code):
=IF(AND(OR(E3={"000"}),OR(F3={1,2,3,4}),OR(G3={4,6,10,14}),OR(I3={1,2,4,5}),OR(R3={5,6,7,8}),OR(T3={0,3,5,7})),"IN","OUT")

The formula work fine, at the cell Z3 it display correctly "OUT" (without quote)

but when i nested the exact same formula with Different reference and different values with "&" it display "OUT" "OUT" (twice)

please can someone tell me where is the error? or how i do nest both formula?

PS
in reality there are 24 formulas with different reference and values that i have to nested


Thank you !!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
The "&" is the concatenation operator. "&" is not used for nesting IF formulas.

="OUT"&"OUT"
gives the same results as
=CONCATENATE("OUT","OUT")

There's a minor change you might make to your working formula.
Rich (BB code):
=IF(AND(E3="000",OR(F3={1,2,3,4}),OR(G3={4,6,10,14}),OR(I3={1,2,4,5}),OR(R3={5,6,7,8}),OR(T3={0,3,5,7})),"IN","OUT")

I do suggest that you not nest your IF formulas. Nesting will create a monster formula that will be too complex to understand or test. You should consider using helper columns.
 
Upvote 0
Hi,

I Know i can do like this :

Rich (BB code):
=IF(AND(OR(E3={"000","001","002","003"}),OR(F3={1,2,3,4}),OR(G3={4,6,10,14}),OR(I3={1,2,4,5}),OR(R3={5,6,7,8}),OR(T3={0,3,5,7})),"IN","OUT")

and for sure will not display the message text twice, But each reference are going to share global values , not the unique values that belong to each reference.
see what's my problem?


Thanks
 
Upvote 0
Hi,

Might be better to post a simple example of your data as well as detailing what you're trying to do. This will make it easier for potential helpers.

Matty
 
Upvote 0
Hi Matty,

Thanks for your response, and Yes i'll post an small sample with phony data.

Thanks
 
Upvote 0
Hi Matty,

I can't download the Mr excel HTML maker, i select the file, click on download and nothing happen.
So i'm copy and paste

NOTE:
References E3:E12 (012,001,010..000) Have unique values across
Because references are dynamic, then i need to nest the formula multiples times for each Reference with their own values, and at the end of the (then) long formula i need to insert the Text "IN", "OUT" , Then drag it from X3 to X12, - NOTE: I understand the issue In the formula E3, it recognize 001 as 1, 000 as 0, the 010 as 10 , etc (the range E3:12 Is formatted as a

Col>EFGHIJKLMNOPQRST UVWX
clip_image002.png
Row

<tbody>
</tbody>
valHTtSk-L3*3--------9*L-Tran--REFTEXT
301215-6--------0-0--012OUT
400112-1--------4-19--001IN
501021-7--------8-21--010OUT
620012-8--------5-4--200OUT
720116-9--------4-2--201OUT
810110-2--------2-6--101IN
902011-0--------3-5--020OUT
1000024-4--------8-7--000IN
1101031-3--------1-21--010IN
1200024-5--------8-7--000OUT

<colgroup><col><col><col><col><col><col><col span="8"><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Hi Andy,

Thanks for the data.

What rules must be observed to make a reference be "In" versus making it "Out"?

Matty
 
Upvote 0
Hi Matty,

the Columns E, F ,G,I ,R,T are dynamic, so when E3 Change, F,G,I,R,T pull some data that is not exact at all time
rules EXAMPLE:
E3 = 012, a reference
F3=1, G3=5 ,I3=6, R3=0, T3=0 <- each column of Row 3 have actual numbers (measure) (in blue to identify)
Then If Formula have 1 numbers different is OUT Otherwise IN

E4 = 001, a reference
F4=1, G4=2 ,I4=2, R4=4, T4=19 <-column of Row 4 have actual numbers
Then If Formula have 1 numbers different is OUT Otherwise IN

E5 = 010, As a reference
F5=2, G5=1 ,I5=7, R5=8, T5=21 <- each column of Row 5 actual numbers
Then If Formula have 1 numbers different is OUT Otherwise IN

etc, etc,etc....

The problem is that because E3:E12 (REFERENCE) are dynamic, Then
each reference can be displayed in any row, e.i
012 is displayed in E3 now, But tomorrow it might be on Row E10 (with it own values which it change time to time)

So that's why i need to nest 24 reference with their values

Hope this explanation is good., if not please let me know..

Thanks!
 
Upvote 0
Hi,

Sounds like a better option would be to maintain a separate table with all of the possible combinations for each reference (as opposed to trying to capture all of the rules within a formula).

You could then use a simple lookup formula to check the validity of the numbers shown across columns F, G, I, R and T.

Does this make sense?

Matty
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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