+ Reply to Thread
Results 1 to 6 of 6

using "isnumber(search" for a range of numbers

  1. #1
    Registered User
    Join Date
    07-21-2009
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    3

    using "isnumber(search" for a range of numbers

    Hello,
    I'm trying to figure out how to write a formula that will recognize the numbers 35-55 in a cell that contains other numbers and letters. If it has the numbers 35-55 then it needs to set the current cell value to zero (by multipling it by zero). I know if you want excel to locate a single number or text you use isnumber(search("text",cell range to look in), but is there a way to tell it to look for a range of numbers within a cell of text and numbers? The only way I could think to do it was by nesting the searches for each numbers using the OR command, but it keeps giving an error message, maybe because it's too many nests.

    =value*IF(OR(ISNUMBER(SEARCH(35,RANGE)),(ISNUMBER(SEARCH(36,RANGE)),(ISNUMBER(SEARCH(37,RANGE)),(ISNUMBER(SEARCH(38,RANGE)),(ISNUMBER(SEARCH(39,RANGE)),(ISNUMBER(SEARCH(40,RANGE)),(ISNUMBER(SEARCH(41,RANGE)),(ISNUMBER(SEARCH(42,RANGE)),(ISNUMBER(SEARCH(43,RANGE)),(ISNUMBER(SEARCH(44,RANGE)),(ISNUMBER(SEARCH(45,RANGE)),(ISNUMBER(SEARCH(46,RANGE)),(ISNUMBER(SEARCH(47,RANGE)),(ISNUMBER(SEARCH(48,RANGE)),(ISNUMBER(SEARCH(49,RANGE)),(ISNUMBER(SEARCH(50,RANGE)),(ISNUMBER(SEARCH(51,RANGE)),(ISNUMBER(SEARCH(52,RANGE)),(ISNUMBER(SEARCH(53,RANGE)),(ISNUMBER(SEARCH(54,RANGE)),(ISNUMBER(SEARCH(55,RANGE))))))))))))))))))))))),0,1)

    Thanks in advance

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: using "isnumber(search" for a range of numbers

    you could use a regular expression if you download and activate the more func add in from http://xcell05.free.fr/morefunc/english/

    =IF(REGEX.COMP(A1,"\b(3[5-9]|4[0-9]|5[0-5])\b")," found","not found")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-21-2009
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: using "isnumber(search" for a range of numbers

    Thank you for the tip. I'll have to download that, unfortunately I don't know C++ at the moment. I did find a way to do it in excel though. For some reason the OR command would only let me nest two isnumber(search commands at a time, even though it's supposed to do 30. I got it to work by just doing two at a time though. Here was the end formula.

    =value*IF(OR(ISNUMBER(SEARCH(35,RANGE)),(ISNUMBER(SEARCH(36,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(37,RANGE)),(ISNUMBER(SEARCH(38,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(39,RANGE)),(ISNUMBER(SEARCH(40,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(41,RANGE)),(ISNUMBER(SEARCH(42,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(43,RANGE)),(ISNUMBER(SEARCH(44,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(45,RANGE)),(ISNUMBER(SEARCH(46,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(47,RANGE)),(ISNUMBER(SEARCH(48,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(49,RANGE)),(ISNUMBER(SEARCH(50,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(51,RANGE)),(ISNUMBER(SEARCH(52,RANGE)))),0,1)*IF(OR(ISNUMBER(SEARCH(53,RANGE)),(ISNUMBER(SEARCH(54,RANGE)))),0,1)*IF(ISNUMBER(SEARCH(55,RANGE)),0,1)

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: using "isnumber(search" for a range of numbers

    C++? nor do i !
    i just read up and trialed and errored a few regular expressions for use with that function
    but


    =OR(ISNUMBER(SEARCH({35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55},A1)))
    is even better!
    Last edited by martindwilson; 07-23-2009 at 10:29 AM.

  5. #5
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    1,992

    Re: using "isnumber(search" for a range of numbers

    Another way,

    Please Login or Register  to view this content.
    Hope this helps,
    windknife

  6. #6
    Registered User
    Join Date
    07-21-2009
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: using "isnumber(search" for a range of numbers

    Wow, both your guy's methods are way easier. Thanks. Quick question, I've never used {} in a formula, what's it do that () don't? Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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