nested If

RUDYTX

New Member
Joined
Apr 9, 2015
Messages
9
Hello!
I need help with this formula. Right now this formula is true if all the values in red are E, 1, N or all the values in blue are E, 1, N
Sometimes my data base wont have data in red or blue, and sometimes will have both. When it has data in red and blue i want my formula to consider the data in blue and ignore the data in red to be true.

Thanks in advance


ABCDEFGHIJK
1
2
310STD44E1NE1NYES
4

<tbody>
</tbody>

K3:
=IF((AND(A3=10,OR(B3="STD",AND(C3=4,D3=4)),OR(AND(E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))),"YES","NO")
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
,OR(AND(E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))

so that is using RED OR BLUE

Does just that formula work for you

 
Upvote 0
I does work for blue or red. Sometimes I want my formula to use only blue (instead of blue or red) to be true.
 
Upvote 0
Dont understand , IF BLUE fits the criteria you get a TRUE
What conditions would you only USE Blue?

can you give an example
 
Upvote 0
Sorry, maybe I didn't explain correctly. This is the scenario:
If red is E 1 N and blue is E 0 N I need to get a False

Thanks for your help
 
Upvote 0
=if((and(a3=10,or(b3="std",and(c3=4,d3=4)),and(and(e3="e",f3=1,g3="n"),and(h3="e",i3=1,j3="n")))),"yes","no")
 
Upvote 0
Thanks for your help. I tried it but also works for two scenarios. It needs to work for all these. Thanks again

E 0 N
E 1 N TRUE
E 1 N E 0 N FALSE (it works)
E 0 N E 0 N FALSE
E 1 N E 1 N TRUE (it works)
E 1 N (NO DATA) TRUE
(NO DATA) E 1 N TRUE

this formula =IF((AND(A3=10,OR(B3="STD",AND(C3=4,D3=4)),OR(AND(E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))),"YES","NO")
works for all these except for E 1 N E 0 N FALSE
 
Upvote 0
Thanks for your help. I tried it but also works for two scenarios. It needs to work for all these. Thanks again

E 0 N
E 1 N TRUE
E 1 N E 0 N FALSE (it works)
E 0 N E 0 N FALSE
E 1 N E 1 N TRUE (it works)
E 1 N (NO DATA) TRUE
(NO DATA) E 1 N TRUE

this formula =IF((AND(A3=10,OR(B3="STD",AND(C3=4,D3=4)),OR(AND(E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))),"YES","NO")
works for all these except for E 1 N E 0 N FALSE
Are those the only scenarios we need to consider or there are others? If there are others, please list them all.
 
Upvote 0
Thanks for your help. I tried it but also works for two scenarios. It needs to work for all these. Thanks again

E 0 N
E 1 N TRUE
E 1 N E 0 N FALSE (it works)
E 0 N E 0 N FALSE
E 1 N E 1 N TRUE (it works)
E 1 N (NO DATA) TRUE
(NO DATA) E 1 N TRUE

this formula =IF((AND(A3=10,OR(B3="STD",AND(C3=4,D3=4)),OR(AND(E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))),"YES","NO")
works for all these except for E 1 N E 0 N FALSE
Judging from the examples you gave, as long as blue is E 1 N, the result must be true. So, you may want to start with

=IF(AND(H3="E",I3=1,J3="N"),"YES",IF(blue has no data,"YES",if(red is E 1 N,"YES,"no more scenario")))
 
Last edited:
Upvote 0
Try this change to your original formula

=IF((AND(A3=10,OR(B3="STD",AND(C3=4,D3=4)),OR(AND(COUNTA(H3:J3)=0,E3="E",F3=1,G3="N"),AND(H3="E",I3=1,J3="N")))),"YES","NO")

I've assumed that for 'no data', that all 3 blue cells should be empty.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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