+ Reply to Thread
Results 1 to 9 of 9

Function to extract string

  1. #1
    Registered User
    Join Date
    04-04-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    95

    Function to extract string

    Hello,

    Need a function to extract the third part from the below strings: (sample worksheet attached)

    DOC. NO. RESULT
    LMH-B-05.1.1-A-01201-00 05.1.1
    LMH-B-08-A-01301-00 08
    LMH-B-04.2-A-01402-00 04.2
    LMH-B-56.03-A-01403-00 56.03


    Thank u.
    Attached Files Attached Files
    Last edited by sharathnarayanan; 12-26-2023 at 02:21 AM.

  2. #2
    Registered User
    Join Date
    10-12-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2019
    Posts
    1

    Re: Function to extract string

    Try
    =RIGHT(RC[-1],LEN(RC[-2])-SEARCH("-",RC[-2]))
    Attached Files Attached Files
    Last edited by lalit387; 12-26-2023 at 03:24 AM.

  3. #3
    Registered User
    Join Date
    04-04-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    95

    Re: Function to extract string

    Not working.
    Last edited by AliGW; 12-26-2023 at 02:44 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,521

    Re: Function to extract string

    Try:

    =LEFT(TRIM(MID(SUBSTITUTE(A2,"-",REPT(" ",99),2),99,99)),FIND("-",TRIM(MID(SUBSTITUTE(A2,"-",REPT(" ",99),2),99,99)))-1)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    04-04-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    95

    Re: Function to extract string

    Perfect.
    Thank you.
    Last edited by AliGW; 12-26-2023 at 03:01 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Function to extract string

    Or try in B2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,521

    Re: Function to extract string

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

    Administrative Note re. Forum Guideline #2:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter and rarely necessary.

    If you are responding out of sequence, it is usually enough just to mention the helper's user name (e.g @AliGW).

    If you do need to quote, limit the quoted section just to the section to which you wish to draw your helper's attention or a direct question to which you wish to respond.

    For normal conversational replies, try using the QUICK REPLY box below or the REPLY button instead of REPLY WITH QUOTE.

  8. #8
    Registered User
    Join Date
    04-04-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    95

    Re: Function to extract string

    Thank u so much HansDouwe & AliGW

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Function to extract string

    You are Welcome!

    Thanks for the feedback and rep .

    Glad to have helped.

+ 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] Function to extract Date from String
    By SAI2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2018, 08:35 PM
  2. [SOLVED] Function to extract specific word from alphanumeric string
    By Karnik in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2015, 02:27 AM
  3. Macro or Function to extract phone numbers and emails from a string
    By jz789 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2013, 10:32 PM
  4. [SOLVED] Macro or Function to extract phone numbers and emails from a string
    By jz789 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2013, 10:31 PM
  5. Function to extract text in a string
    By anilbavaraju in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2010, 01:06 PM
  6. problem with len() function to extract date from string
    By ramserp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2009, 10:26 AM
  7. MID function formula string extract problem
    By ExcelNewby in forum Excel General
    Replies: 3
    Last Post: 02-22-2009, 06:36 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