Excel Nesting Problem *Help Needed*

czech09

Diamond Member
Nov 13, 2004
8,990
0
76
I've been working on this since this morning and can't figure this problem out:


I've been working on this for at least 30 minutes now and can't seem to figure this thing out, if anyone could help that'd be great thanks in advance...

Problem:

You are interested in knowing IF the logical test of an AND statement that consists of 0, 1, 1 is true or false.

The result of this AND statement, if true is another IF statement that has B10 as the logical test the word True for the true argument and the word false for the false argument.

The false argument is another IF statement that has B11 as the logical test and then 1 as the true arg. and 0 as the false argument.

The answer to that IF statement is one of three arguments in an OR statement. The other 2 arguments are the words True and False

Now the result of the Or is the logical test of an IF that has "ABC" as the true and "DEF" as its false.


This is what I think it is but when I put it into excel it says there's an error somewhere:

=IF(AND(0,1,1 IF(B10, "True", "False" IF(B11, 1, 0 IF(OR("ABC", "DEF"))))))

 

petesamprs

Senior member
Aug 2, 2003
278
0
76
Your formula is all messed up. I'm not sure what you're trying to accomplish, but here's what your language translates to, I think:

=If(OR("True","False",IF(AND(0,1,1)=True,IF(B10,"True", "False"),IF(B11, 1, 0))),"ABC","DEF")
 

czech09

Diamond Member
Nov 13, 2004
8,990
0
76
Thanks for the help but that throws an error too (btw you can't have 2 "=" in an excel formula but I deleted it).

It's a homework problem in my computer science class - heh that's what I'm trying to accomplish.

I can understand the simple AND OR or IF functions but nesting like 4 of them here is getting me confused...

 

czech09

Diamond Member
Nov 13, 2004
8,990
0
76
=IF(AND(0,1,1), IF(B10, "True", IF(B11, 1, 0) IF(OR("ABC", "DEF"), "True", "False")))

I think I got it ^ can anyone check to see if that's right...this at least gives me "False" now instead of an error...

Thanks again.
 

PowerEngineer

Diamond Member
Oct 22, 2001
3,615
799
136
Originally posted by: czech09
=IF(AND(0,1,1), IF(B10, "True", IF(B11, 1, 0) IF(OR("ABC", "DEF"), "True", "False")))

I think I got it ^ can anyone check to see if that's right...this at least gives me "False" now instead of an error...

Thanks again.

Hmmmm....

I am pretty confused about what you are attempting to do here. Since the "1" is always treated as "TRUE" and the "0" as "FALSE" when used in the AND statement, then your AND(0,1,1) is always FALSE

What am I missing?

 

JustAnAverageGuy

Diamond Member
Aug 1, 2003
9,057
0
76
Originally posted by: czech09
=IF(AND(0,1,1), IF(B10, "True", IF(B11, 1, 0) IF(OR("ABC", "DEF"), "True", "False")))

I think I got it ^ can anyone check to see if that's right...this at least gives me "False" now instead of an error...

Thanks again.

When you get errors like this, it may be helpful to space it out and write it like a normal programming language. That's what I don't like about excel: Complex formulas are difficult to read, but if I've done this correctly, what you have now translate roughly into this. Perhaps it'll help solve your problem.

I used tabs instead of braces to make it easier to read the logic flow, but if I misread your's, it'll be way off.

The first condition is always false though so the rest of the code is meaningless the way you have it (You can check by setting a cell equal to =(AND(0,1,1)) which displays 'FALSE')

The code box below should explain the logic of the problem. In fact, it does nearly everything except give you the answer in excel format ;)

- JaAG