+ Reply to Thread
Results 1 to 5 of 5

Formula to search a range for a string and then extract certain dta from string

  1. #1
    Registered User
    Join Date
    03-28-2017
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    20

    Formula to search a range for a string and then extract certain dta from string

    Hi,

    In the attached file, the data sheet contains a list of items in column A.
    The output tab reflects the data I want to search for then extract from the Data tab, so I am looking for formulas to get the output shown in Columns A and B of the output tab.

    The problem is that some of the data items are very similar in name, so using a wildcard to search makes things tricky.

    In summary, I would like a formula that searches the range of column A in the data tab for the search criteria in Column E of the output tab, then output the findings to Column A of the output tab.
    Then based on what populates in Column A of the output tab, I want to pull the corresponding percentages.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Formula to search a range for a string and then extract certain dta from string

    Here is one possible solution with two caveats:
    1) All percentages MUST contain a decimal point
    2) Text without any percentage will result in blank output, so the output must be filtered by non-empty cells.

    The formula to find the text portion would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And the formula for the percentage value would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Formula to search a range for a string and then extract certain dta from string

    Hi,

    If I understand correctly:

    Output tab A2 copied down:

    =IFERROR(LEFT(LOOKUP(2,1/SEARCH(E2,Data!A$1:A$9),Data!A$1:A$9),MIN(FIND({0,1,2,3,4,5,6,7,8,9},LOOKUP(2,1/SEARCH(E2,Data!A$1:A$9),Data!A$1:A$9)&"0123456789"))-2),"")

    Output tab B2 copied down:

    =IFERROR(SUBSTITUTE(LOOKUP(2,1/SEARCH(E2,Data!A$1:A$9),Data!A$1:A$9),A2,"")+0,"")

    Refer to attached sample.
    Attached Files Attached Files
    Last edited by jtakw; 08-07-2018 at 09:16 PM. Reason: updated 2nd formula

  4. #4
    Registered User
    Join Date
    03-28-2017
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    20

    Re: Formula to search a range for a string and then extract certain dta from string

    Thank you danielexcelvba and jtakw for your great responses. Both suggestions work perfectly.

  5. #5
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Formula to search a range for a string and then extract certain dta from string

    You're welcome, glad it works for you, thanks for the feedback.

+ 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. [SOLVED] extract multi-letter string bits from string depending on size and case
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-18-2017, 10:41 PM
  2. Replies: 4
    Last Post: 10-25-2016, 04:45 PM
  3. [SOLVED] Extract all the words from a string for processing, while leaving string intact.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-10-2014, 02:02 PM
  4. [SOLVED] How to Extract A Number from String if Text within the String Equals XYZ
    By tyrsfury in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-15-2012, 03:30 PM
  5. [SOLVED] Extract a mainly numeric string (ISSN number) from an arbitrary string
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-04-2012, 01:49 PM
  6. Replies: 16
    Last Post: 10-11-2011, 12:31 PM
  7. Extract small string of text from larger string
    By mark_jam3s in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2010, 05:36 AM

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