Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
wmurphyjr
 
Posts: n/a
Default How do I use 'And' or "Or" in an If statment

Want to compare if cell 1 = "UP" AND cell 20 are true, then say OK, if cell
1="up" and cell 2 <0,then say "Bad", other wise say "Wrong"
  #2   Report Post  
Paul B
 
Posts: n/a
Default

wmurphyjr, try this,
=IF(AND(A1="up",A20),"OK",IF(AND(A1="up",A2<0),"B ad","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

"wmurphyjr" wrote in message
...
Want to compare if cell 1 = "UP" AND cell 20 are true, then say OK, if

cell
1="up" and cell 2 <0,then say "Bad", other wise say "Wrong"



  #3   Report Post  
Leo Heuser
 
Posts: n/a
Default

Murphy

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

=IF(AND(EXACT(A1,"UP"),B10),"OK",IF(AND(EXACT(A1, "up"),B1<0),"Bad","Wrong"))

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"wmurphyjr" skrev i en meddelelse
...
Want to compare if cell 1 = "UP" AND cell 20 are true, then say OK, if
cell
1="up" and cell 2 <0,then say "Bad", other wise say "Wrong"






  #4   Report Post  
Paul B
 
Posts: n/a
Default

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

"Leo Heuser" wrote in message
...
Murphy

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


=IF(AND(EXACT(A1,"UP"),B10),"OK",IF(AND(EXACT(A1, "up"),B1<0),"Bad","Wrong")
)

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"wmurphyjr" skrev i en meddelelse
...
Want to compare if cell 1 = "UP" AND cell 20 are true, then say OK, if
cell
1="up" and cell 2 <0,then say "Bad", other wise say "Wrong"








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"