Consulting

Results 1 to 9 of 9

Thread: Using the AND command

  1. #1

    Using the AND command

    Could someone please show me how to use the AND command.
    I have tried the following but I must be leaving something out.
    =AND(O2="down",M2="up") Both O2 and M2 should equal a TRUE. What am I doing
    wrong. Thanks
    Max

  2. #2
    VBAX Regular WillR's Avatar
    Joined
    May 2004
    Location
    Rugby - UK
    Posts
    60
    Location
    Nothing wrong with that formula

    It will return TRUE if the value in O2 is "down" & the value in M2 is "up"

    FALSE if either or both are not
    Will
    Not all chemicals are bad. Without chemicals such as hydrogen and oxygen for example, there would be no way to make water, a vital ingredient in beer.

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hi,

    Are you sure you want an AND and not an OR statement? How about posting your entire formula along with what data your attempting to manipulate. You can upload zipped attachments of your file if you'd like.

    (Hi Will! Still feeding the penguin I hope! )

  4. #4
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    You may want to try:
    =AND(upper(O2)="DOWN",upper(M2)="UP")
    That just ignores the case in O2 and M2. Not sure if that's the issue, but I can't think of what else the issue is, why it wouldn't return TRUE if o2 is "down" and m2 is "up"
    Matt

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    A couple of simple examples
    MD

  6. #6
    VBAX Mentor CBrine's Avatar
    Joined
    Jun 2004
    Location
    Toronto, Canada
    Posts
    387
    Location
    Another Option that might help is the trim.

    =AND(upper(trim(O2))="DOWN",upper(trim(M2))="UP")

    HTH
    The most difficult errors to resolve are the one's you know you didn't make.


  7. #7
    Thanks guys for the super replys. I have the formula working now.

    Max

  8. #8
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Quote Originally Posted by Tenspeed39355
    Thanks guys for the super replys. I have the formula working now.

    Max
    Great!

    Just wrought out of curiosity, what was the problem, and the formula used to fix?

  9. #9
    Firefytr
    In my first post I said the following.
    =AND(O2="down",M2="up") Both O2 and M2 should equal a TRUE. What am I doing
    wrong. Thanks
    I said a misstatement. In my ss I had =AND(O2="FALSE". When I changed it to "down" that fixed the problem. Sorry for the confusion.
    Max

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •