+ Reply to Thread
Results 1 to 10 of 10

Find text within text and then return that text

Hybrid View

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Vero Beach, FL
    MS-Off Ver
    10
    Posts
    13

    Find text within text and then return that text

    I have a spreadsheet that contains a style number that I need to lookup in a column of text fields, when it finds that style number I need it to return the entire text string in the description field.
    Column A has the text I am searching for in Column J, when it finds it I need the entire field of J to appear in Column B.
    Thank you in advance for your help.
    Attached Files Attached Files
    Last edited by Brendadob; 06-05-2017 at 06:15 PM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Find text within text and then return that text

    Hi Brendadob- paste this ARRAY FORMULA in B2, then press CTRL+SHIFT+ENTER to confirm:
    =INDEX(LEFT($J$2:$J$270,LEN($J$2:$J$270)-LEN(A2)-3),MATCH(" - " & A2,RIGHT($J$2:$J$270,LEN(A2)+3),0),1)
    Formula updated 7:17 pm-LLN

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Attached Files Attached Files
    Last edited by leelnich; 06-05-2017 at 07:18 PM.

  3. #3
    Registered User
    Join Date
    06-25-2014
    Location
    Vero Beach, FL
    MS-Off Ver
    10
    Posts
    13

    Re: Find text within text and then return that text

    Thank you so much for your reply. Unfortunately I get #N/A when I copy the formula in.

  4. #4
    Registered User
    Join Date
    06-25-2014
    Location
    Vero Beach, FL
    MS-Off Ver
    10
    Posts
    13

    Re: Find text within text and then return that text

    Also, I'm okay if it enters the line as is, there is no need to take the style number out of Column J when placing in Column B.

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Find text within text and then return that text

    Just updated post #2. If you've already downloaded, Re-Do.

  6. #6
    Registered User
    Join Date
    06-25-2014
    Location
    Vero Beach, FL
    MS-Off Ver
    10
    Posts
    13

    Re: Find text within text and then return that text

    2nd Edit worked on some but not all

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,967

    Re: Find text within text and then return that text

    Or try this ...

    =LOOKUP(2,1/(RIGHT($J$2:$J$270,LEN(A2)+2)="- "&A2),$J$2:$J$270)

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Find text within text and then return that text

    Here's an updated version.
    =INDEX($J$2:$J$270,MATCH(" - " & A2,RIGHT($J$2:$J$270,LEN(A2)+3),0),1)

    The #NA means you didn't confirm the ARRAY FORMULA correctly. Follow these steps:
    1) Select B2
    2) Press the F2 key. This puts you in edit mode, with the cursor in the formula bar.
    3) Paste the formula. DO NOT PRESS ENTER...
    4) Instead, press CTRL+SHIFT+ENTER, all at once. You should see curly brackets {} appear around the formula, indicating it's ARRAY status.
    5) Press CTRL+C to copy cell B2
    6) Select B3:B270 and paste. You should now see the correct results.

    NOTE- With Array formulas, the copied cell CANNOT be part of the PASTE area. This differs from normal copy/paste procedures.

    ps.: Don't forget to turn Automatic calculation back on. I wasted 15 minutes trying to figure out why the original formula wasn't working before I thought to check.
    Last edited by leelnich; 06-05-2017 at 07:56 PM.

  9. #9
    Registered User
    Join Date
    06-25-2014
    Location
    Vero Beach, FL
    MS-Off Ver
    10
    Posts
    13

    Re: Find text within text and then return that text

    No, I'm an idiot. Because my file was so big, I only uploaded a small portion of it. All done! Thank you so much!

  10. #10
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Find text within text and then return that text

    Happy to help, Thank you for the rep!

+ 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. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  2. Replies: 2
    Last Post: 09-07-2013, 07:50 PM
  3. [SOLVED] Find Text In Range With Part Of Text & Return True or False
    By tis28 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-30-2013, 09:35 PM
  4. [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
  5. [SOLVED] nested if function trying to find text and return text in different cell
    By shelbyleighh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-14-2013, 12:16 PM
  6. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  7. [SOLVED] Find Specific Text in Text String and Return Value in Adjacent Column
    By watchouse in forum Excel General
    Replies: 2
    Last Post: 07-11-2012, 03:53 PM

Tags for this Thread

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