Originally Posted by
benishiryo
welcome to the forum, my fellow Singaporean.
1. TRUE & FALSE are recognized words of the formula. so it means you can actually use it without the double quotes:
=IF(AND(A1=5,A2=5,A3=5,A4=5),True,False
Sorry about the True/False confusion. I actually used "Yes" and "No" when playing around but I thought that True or False would be more widely 'understandable'.
Am I safe to assume that anything other than True or False will require the double quotes?
2. by using logical tests (i.e. A1=5), it will already return TRUE or FALSE. so do away with the IF:
=AND(A1=5,A2=5,A3=5,A4=5)
3. The formula you stated =IF(AND(A1,A2,A3,A4=5),"True","False") does not work. try changing any of them to any other values than 0 & it'll still show as TRUE.
Just tested it out again. You are correct. Is this just a bad formula?
Edit: I tested a bit more.. it seems that changing any values from A1:A3 will result in a True. But if I change only A4 then the result is a false. I think it must be something with the way the formula is written. This further confuses me. haha
4. not sure where your notes come from. doesn't seem right. the only way you can do it by testing a range of cells with a logical test is:
=A1:A4=5
this is called an array though. it's something more advanced. the cell actually produces 4 results but are unable to show it. it's actually to do something more complex. you can try:
=AND(A1:A4=5)
and instead of ENTER, press CTRL + SHIFT + ENTER
Tested it out. It works. Also tested it with the in combination with IF as per my initial attempts and it works when i end the formula with the array thing you mentioned {=IF(AND(A1:A4=5),TRUE,FALSE)}
Now you got me wondering what an array is. More for me to read up on. =D
for your case, you can avoid doing the above. array formulas slow down the files. you can simply use:
=COUNTIF(A1:A4,5)=4
that is to count how many cells in A1:A4 is 5. i then do a logical test to see if the total is 4 counts.
What is the logical test to see if the total is 4 counts? does COUNTIF already tell you that? I'm confused.
hope that helps
Bookmarks