+ Reply to Thread
Results 1 to 8 of 8

Search exact word within a string - SEARCH formula help

  1. #1
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Search exact word within a string - SEARCH formula help

    Hi

    I am trying to make an exact search within a string using SEARCH formula

    For eg. I have to search for 1-20 within the string "10,11,12,13,14,15" using SEARCH formula
    The formula gives found result for 1 as it is finding 1 from 10
    How to make the search exact??

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Search exact word within a string - SEARCH formula help

    Enter your string in cell A1 ("10,11,12,13,14,15")
    Enter value you are searching for in cell B1

    Enter this formula in cell C1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It is using the "comma" before and after to refine the search.
    Also note that it has a "comma" added before &A1 - this allows it to find the number if it's the first item in the cell

    EDIT - just realised that above formula will not find the last item in the cell, so have added another "comma" after the &A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by kev_; 11-23-2016 at 11:01 AM. Reason: amended formula

  3. #3
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: Search exact word within a string - SEARCH formula help

    Hi,
    Found the edit very late
    Thanks kev_!!!
    Last edited by chullan88; 11-23-2016 at 11:41 AM.

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Search exact word within a string - SEARCH formula help

    Use MATCH and separate the values in an array instead of a single string.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Search exact word within a string - SEARCH formula help

    Try

    =SEARCH(","&B1&",",","&A1 &",")

  6. #6
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: Search exact word within a string - SEARCH formula help

    Quote Originally Posted by Jacc View Post
    Use MATCH and separate the values in an array instead of a single string.
    Hi Jacc,

    could you please demonstrate?

  7. #7
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: Search exact word within a string - SEARCH formula help

    Quote Originally Posted by JohnTopley View Post
    Try

    =SEARCH(","&B1&",",","&A1 &",")
    Thanks JohnTopley!!!!

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Search exact word within a string - SEARCH formula help

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. search exact word
    By sanju2323 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-02-2015, 06:08 AM
  2. Don't want it to be necessary for exact string to be typed into search box.
    By excelnoob927 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2015, 05:33 PM
  3. Search and Remove Exact String
    By Beaster in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-04-2013, 02:28 PM
  4. Replies: 2
    Last Post: 05-28-2013, 12:41 AM
  5. Search for EXACT string
    By jarochnrol in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2011, 11:39 AM
  6. How to search a range for exact word?
    By jgomez in forum Excel General
    Replies: 2
    Last Post: 07-14-2011, 10:58 AM
  7. [SOLVED] a exact string search inquiry
    By vito in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-10-2006, 09:10 AM

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