How do I use 'And' or "Or" in an If statment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Want to compare if cell 1 = "UP" AND cell 2>0 are true, then say OK, if cell
1="up" and cell 2 <0,then say "Bad", other wise say "Wrong"
 
wmurphyjr, try this,
=IF(AND(A1="up",A2>0),"OK",IF(AND(A1="up",A2<0),"Bad","Wrong"))

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
Murphy

When the case is important like here, you can use EXACT() as in:

=IF(AND(EXACT(A1,"UP"),B1>0),"OK",IF(AND(EXACT(A1,"up"),B1<0),"Bad","Wrong"))
 
Leo, I missed the upper and lower "up", thanks for the catch
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combine IF Statments 2
If statments 2
Mapping integers to strings 5
Excel VBA 1
Excel Need Countifs Formula Help 0
Function Conflicts with an If/Then Statement 2
An if statment tat returns a true blank 4
Event recognition. 6

Back
Top