Hello, this is my first time posting. I had posted this question in the general forum, and I would erase from there it if I could since I know I'm not supposed to double post.
The question seemed more relevant in this "new users" forum because I'm totally new to Excel and trying to figure things out. So perhaps a moderator can erase the original post.
I'm trying to create a function for cell B2 that would have the following components:
If cell B3 is the letter "A" and cell B4 < 0, then output the word "YES"; otherwise output the word "NO." I have managed to make this component work by itself:
=IF(AND(B3="A",(B4<0)),"YES","NO")
Also, if B3 is the letter "Z" and B4 < 0, then output the word "NO"; otherwise output the word "YES." That string works by itself:
=IF(AND(B3="Z",(B4<0)),"NO","YES")
What I am having a ridiculously hard time figuring out is how to include both strings in the same formula. I'm sure it's not too hard, but I just can't seem to do it. I think it must involve the "OR" command somehow...? Thanks for any help!
Last edited by Capa; 02-19-2010 at 02:42 PM.
Try this
=IF(AND(OR(B3="A",B3="Z"),B4<0),"NO","YES")
Regards
I would think it would be:
=IF(OR(AND(B3="Z",B4<0), AND(B3="A",B4>=0)), "NO", "YES")
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thank you, but the problem is that I want it to say "NO" if B4<0 *only* when B3="A". In the second condition of the OR, B3=Z, it's the reverse. In that case I would want it to say "YES" if B4<0 and "NO" otherwise.
The way it's written above, it will output the same word regardless of whether B3="A" or "Z", but I want it to output the opposite word for each case.
Thanks again!
Mine was a wrong answear.
Last edited by sailepaty; 02-16-2010 at 03:14 PM.
Hi,
Try
Code:=IF(OR(AND(B3="A",(B4<0),AND(B3="Z",(B4<0)),"NO","YES"))
Richard Buttrey
If this was useful then please rate it appropriately.
Click the small star iconat the bottom left of my post.
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
============
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks