+ Reply to Thread
Results 1 to 2 of 2

Search for text substring

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    australia
    MS-Off Ver
    7
    Posts
    2

    Search for text substring

    Hi guys,

    First time poster and fairly new excel user, so I appreciate any help that the members here can offer.

    I would like to write a formula that searches for the substring (i'm not sure if that's the right term) of text 'tHR' within cells that contain data that appears like this...

    VApredictHR1L1
    FeedbackLL
    BVpredictLR1L1
    FeedbackLR
    AVpredictHR1L2
    FeedbackHR

    etc....

    I would like it to return either a value of '1' or '0' or reading of 'true' or 'false'. Additionally, I would like to be able to drag it down the column.

    The best I've come up with is...

    =IF(E1="","",SEARCH("*tHR*",E1))

    Which returns a value of '1' where the top line in the raw data sample above is cell E1. However this cannot be dragged down.

    Thanks for any help guys. I really appreciate it as i recognise that this may not be the most advanced problem.


    Matt.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Search for text substring

    Hi, welcome to the forum

    there are many ways to do this, here is 1 of them...
    A
    B
    1
    VApredictHR1L1
    TRUE
    2
    FeedbackLL
    FALSE
    3
    BVpredictLR1L1
    FALSE
    4
    FeedbackLR
    FALSE
    5
    AVpredictHR1L2
    TRUE
    6
    FeedbackHR
    FALSE

    B1=ISNUMBER(SEARCH("tHR",A1,1))
    Copied down

    You were almost there with your formula, you just needed to error-trap...
    =IF(A1="","",IFERROR(SEARCH("*tHR*",A1),""))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 2
    Last Post: 05-21-2015, 03:09 AM
  2. [SOLVED] Possible to search for a substring withing a string of text which is an exact match?
    By Urugmo88 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2014, 04:09 AM
  3. Search substring within range, report the substring found
    By Brooke1578 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2012, 03:56 PM
  4. [SOLVED] If/Then function with substring search
    By bluefawn42 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-31-2012, 10:04 AM
  5. Search string for substring...return match
    By Gambinus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-21-2012, 03:18 PM
  6. Search for SubString
    By Hallet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2012, 04:38 AM
  7. Search for Substring within a String using loop
    By Hallet in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-09-2012, 01:31 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