+ Reply to Thread
Results 1 to 11 of 11

using an OR statement inside a =if(isnumber(search( formula

  1. #1
    Forum Contributor
    Join Date
    08-13-2009
    Location
    Caribbean
    MS-Off Ver
    Excel 2003
    Posts
    129

    using an OR statement inside a =if(isnumber(search( formula

    Hello All,

    What I am trying to do is search for multiple terms within a single cell and return a value if it finds it, or return something else if it doesnt. This is what I have so far but it doesn't seem to be working.

    =if(isnumber(search(or("llc","corp","ltd","limited","strata"),K2))),"Company","Individual")

    I know that I can do it this way but it is far too cumbersome:

    =if(or(isnumber(search("llc",k2)),isnumber(search("corp",k2)),isnumber(search("ltd",K2))),"Company","Individual")


    My question is can I not include the OR statement after the search to search for multiple variables that way?

    Thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using an OR statement inside a =if(isnumber(search( formula

    You were very close.

    Try it like this:

    =IF(OR(ISNUMBER(SEARCH({"llc","corp","ltd","limited","strata"},K2))),"Company","Individual")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: using an OR statement inside a =if(isnumber(search( formula

    Here, try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: using an OR statement inside a =if(isnumber(search( formula

    Or this maybe:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-13-2009
    Location
    Caribbean
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: using an OR statement inside a =if(isnumber(search( formula

    Quote Originally Posted by Tony Valko View Post
    You were very close.

    Try it like this:

    =IF(OR(ISNUMBER(SEARCH({"llc","corp","ltd","limited","strata"},K2))),"Company","Individual")
    Went with this one... works like a charm thank you!

    Quick question, what is the effect of having the { inside the formula? I thought that was used for array formula?

  6. #6
    Forum Contributor
    Join Date
    08-13-2009
    Location
    Caribbean
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: using an OR statement inside a =if(isnumber(search( formula

    Quote Originally Posted by zbor View Post
    Here, try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you, your take is rather itneresting as well. Why the "--" at the beginning of the isnumber?

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using an OR statement inside a =if(isnumber(search( formula

    Quote Originally Posted by mysticmoron109 View Post
    Quick question, what is the effect of having the { inside the formula? I thought that was used for array formula?
    When the { } are inside the formula this is known as an array constant. It holds an array of items that are static (constant). The items can not be cell references like {B2,C2}.

    When the { } surround the formula this denotes an array formula.

    {=OR(A1:A5="X")}

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: using an OR statement inside a =if(isnumber(search( formula

    Quote Originally Posted by mysticmoron109 View Post
    Thank you, your take is rather itneresting as well. Why the "--" at the beginning of the isnumber?
    -- will convert TRUE/FALSE statements into 1/0 numbers that you can easily SUM

  9. #9
    Forum Contributor
    Join Date
    08-13-2009
    Location
    Caribbean
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: using an OR statement inside a =if(isnumber(search( formula

    AH perfect, thank you guys so much for the tips! Will add to my excel arsenal

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: using an OR statement inside a =if(isnumber(search( formula

    Another way...

    =IF(SUM(COUNTIF(K2,"*"&{"llc","corp","ltd","limited","strata"}&"*")),"Company","Individual")

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using an OR statement inside a =if(isnumber(search( formula

    You're welcome! Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] My =IF(ISNUMBER(SEARCH Formula is Not Working
    By thanhie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-03-2022, 12:30 AM
  2. [SOLVED] Help with a isnumber, iferror, search formula
    By shiftyspina in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2015, 08:31 AM
  3. [SOLVED] IF AND ISNUMBER SEARCH formula bringing back Value
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2015, 11:03 AM
  4. Need help with isnumber(search) Formula
    By lpretor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-15-2013, 08:14 PM
  5. [SOLVED] Modification of a IF ISNUMBER SEARCH formula
    By zigojacko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-16-2013, 04:20 AM
  6. Nested IF statement with multiple ISNUMBER(SEARCH) formula
    By mlester in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-08-2013, 12:40 PM
  7. using IF(ISNUMBER(SEARCH formula
    By dkmanley in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-19-2011, 01:43 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1