OR Statements
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: OR Statements

  1. #1
    Board Regular
    Join Date
    Dec 2017
    Posts
    100
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default OR Statements

     
    Hello,

    I'd like to understand how to make OR statements within a formula. What I'm aiming to do is have a formula evaluate more than one condition and provide the same result if A or B is true.

    Example:

    =IF(ISNUMBER(FIND("Chrome",F2)),"Chrome","0")

    I've advanced a little bit in the last month or so with Formulas so I've been experimenting with making formulas work on my own more. What I can't get working though is,

    =IF(ISNUMBER(FIND("Chrome",F2,OR("Chr",F2))),"Chrome","0")

    What i'd like to see happen is this formula evaluate F2 for both "Chrome" and "Chr" and if either of those conditions is evaluated as true then I would like it to return "Chrome". I don't want to have to write two complete arguments to do that though. I'd like it to evaluate both of those within one statement.

    Hope you are well,

    Steve

  2. #2
    Board Regular
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    5,303
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: OR Statements

    For your example you can just search for Chr as Chr is within Chrome.

  3. #3
    MrExcel MVP mikerickson's Avatar
    Join Date
    Jan 2007
    Location
    Davis CA
    Posts
    21,585
    Post Thanks / Like
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)

    Default Re: OR Statements

    I would use

    =IF(OR(ISNUMBER(FIND("CHROME",F2)), ISNUMBER(FIND("Chr",F2))), F2, "0")

  4. #4
    Board Regular
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    5,303
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: OR Statements

    If you did need an OR in there you could use:

    =IF(OR(ISNUMBER(FIND({"Chr","Chrome"},F2))),"Chrome","0")

    or not case sensitive:

    =IF(OR(ISNUMBER(SEARCH({"Chr","Chrome"},F2))),"Chrome","0")

  5. #5
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    2,770
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: OR Statements

    to use the OR() with your example,

    =IF(OR(ISNUMBER(FIND("Chr",F2)),ISNUMBER(FIND("Chrome",F2))),"Chrome","0")

  6. #6
    Board Regular
    Join Date
    Dec 2017
    Posts
    100
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: OR Statements

    Quote Originally Posted by steve the fish View Post
    If you did need an OR in there you could use:

    =IF(OR(ISNUMBER(FIND({"Chr","Chrome"},F2))),"Chrome","0")

    or not case sensitive:

    =IF(OR(ISNUMBER(SEARCH({"Chr","Chrome"},F2))),"Chrome","0")
    STEVE THE FISH

    How do I make those lil squiggly bars work. Control + Shift + Enter right?

  7. #7
    Board Regular
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    5,303
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: OR Statements

    Quote Originally Posted by SteveOranjin View Post
    STEVE THE FISH

    How do I make those lil squiggly bars work. Control + Shift + Enter right?
    In this example they will just work with ENTER.

  8. #8
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    31,218
    Post Thanks / Like
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)

    Default Re: OR Statements

      
    As an alternative:

    =IF(COUNT(SEARCH({"Chr","Chrome"},F2)),"Chrome","0")

User Tag List

Tags for this Thread

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