OR statement
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: OR statement

  1. #1
    Guest

    Default

     
    Question:
    Can I put an OR statement inside an IF formula?
    if yes how would you use that?
    Thanks in advance

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,790
    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)

    Default

    On 2002-03-11 11:21, Anonymous wrote:
    Question:
    Can I put an OR statement inside an IF formula?
    if yes how would you use that?
    Thanks in advance
    Example:

    =IF(OR(A1="X",A1="Y"),A1*B1,0)

    which says: if A1 is either equal to "X" or equal to "Y", give the result of A1*B1, otherwise 0 in the cell where this formula is.

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    =IF(OR(A1=1,B1=2),A1*B1,A1)

  4. #4
    New Member
    Join Date
    Feb 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    for example put in b1:
    =IF(OR(A1=1,A1=2),"y","n")
    If a1 contains 1 or 2 then you get y
    else n
    Eli

  5. #5
    Guest

    Default

    I am using the Conditional Format
    After selecting columnB,I typed in
    =OR(c1="",c1="Test")
    eg. change text in columnB to white if c1="" or c1=Test
    However, it doesn't work
    Should I add more statment in the formula
    Thanks guys

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-11 11:36, Anonymous wrote:
    I am using the Conditional Format
    After selecting columnB,I typed in
    =OR(c1="",c1="Test")
    eg. change text in columnB to white if c1="" or c1=Test
    However, it doesn't work
    Should I add more statment in the formula
    Thanks guys
    If you mean to test for an empty cell try this instead...

    =OR(ISBLANK(C1),C1="Test")

  7. #7
    Guest

    Default

      
    Yes it works
    Thanks guys, I am very appreciated

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com