+ Reply to Thread
Results 1 to 5 of 5

Find a string of text within a string

  1. #1
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Find a string of text within a string

    I know its simple but I can't get it to work right.

    =IF(ISNUMBER(SEARCH(OR("bill","Credit"),[@Descriptn])),"BillBack",[@[Our Ref Trim]])

    If the Descriptn has "bill" or "Credit" anywhere with the text string, I want to return "BillBack", if not, return the value of "Our Ref Trim"

    So, I entered the formula above but it is not catching descriptions that contain "billback", "bill ", "credit"

    Please help.

    PS. "Our Ref Trim" is the helper column I use to =Trim() the "Our Ref" column. I'd like to get rid of the "Our Ref Trim" column and just add the "Trim" function within the formula above.

    Thanks!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Find a string of text within a string

    Hi rs1aj,

    Try putting "*" in you search and see what happens.
    Change the
    OR("bill","Credit")
    to
    OR("*bill*","*Credit*")
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Find a string of text within a string

    =IF(SUMPRODUCT(--(NOT(ISERR(SEARCH({"credit","bill"},A1)))))>0,1,"") will do the job. wrap that up in your isnumber function and the rest of your formula and it'll work perfectly.
    Last edited by Glenn Kennedy; 06-02-2015 at 09:55 AM. Reason: Removed the set of " round the 1 at the end... Sorry, not thinking....
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Find a string of text within a string

    Works perfect. Thanks!

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Find a string of text within a string

    You're welcome.

+ 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: 4
    Last Post: 03-30-2015, 03:20 PM
  2. Replies: 2
    Last Post: 03-18-2015, 07:30 PM
  3. Replies: 5
    Last Post: 02-11-2015, 10:41 PM
  4. [SOLVED] Find and extract text string from within another text string
    By huy_le in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2013, 03:22 PM
  5. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 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