+ Reply to Thread
Results 1 to 7 of 7

Extract specific strings that is next to a specific text - inconsistent data format

  1. #1
    Registered User
    Join Date
    08-25-2022
    Location
    California
    MS-Off Ver
    MS Office Pro Plus 2021
    Posts
    2

    Angry Extract specific strings that is next to a specific text - inconsistent data format

    Hello everyone,

    This is a pretty tough one to figure out, so major major thank you if are able to help me out.

    Here is a rather inconsistent data format. My goal here is to extract the target percentage out of these data. So in the bottom example, I want the second column to spit out 21.5%, 24%, and 20.53% respectively. We only want to extract the percentage that is adjacent to "target"

    Column A Column B
    James Doe homework 21.5% target 21.5%
    All member discount 18%|24% target 24%
    Other members discount 15%|20.53% target 20.53%

    Thanks you!

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,873

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    This is assuming 2 things:
    1. Percentage always follows "target "
    and
    2. That the percentage is always at the end of the cell

    =RIGHT(A1,LEN(A1)-SEARCH("target ",A1)-6)

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,873

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    The above extracts as TEXT. If you need the actual number as a percentage, try this:

    =VALUE(MID(A1,SEARCH("target ",A1)+6,LEN(A1)-SEARCH("target ",A1)-6))/100

    (and set the field to format of "Percentage")

  4. #4
    Registered User
    Join Date
    08-25-2022
    Location
    California
    MS-Off Ver
    MS Office Pro Plus 2021
    Posts
    2

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    Thanks for the response Gregb11

    I tried both of your suggestions, but the first returned a blank, and the second one prompt a Value error message. Any thoughts on what might be the issue? I switched A1 to A2 in the formula by the way.

    My original post had weird formatting, so attaching what I want the outcome to be.

    Thanks!

    Attachment 793590

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,873

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    Please read the yellow banner at the top of the page for attaching a sample workbook. The link doesn't work.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,873

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    And attached is my workbook with my formulas in it.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,873

    Re: Extract specific strings that is next to a specific text - inconsistent data format

    You're welcome. Thanks for the feedback and 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. Replies: 4
    Last Post: 07-14-2020, 04:13 PM
  2. [SOLVED] Excel VBA - Extract multiple strings from single string seperated by specific character
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2019, 02:17 PM
  3. [SOLVED] remove character strings in a specific pattern..
    By mohit999 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-15-2018, 06:29 AM
  4. [SOLVED] Extract specific words/strings from a cell
    By deerguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-07-2017, 05:17 PM
  5. Search a specific character if meet look for another then extract data
    By seolann in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 11-11-2014, 08:25 AM
  6. [SOLVED] Extracting specific data from large inconsistent strings
    By Karnik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-01-2013, 01:52 AM
  7. Extract specific strings within a cell macro
    By ardniw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2013, 03:41 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