+ Reply to Thread
Results 1 to 9 of 9

Inserting text in front of digits in a string that has delimiters

  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    9

    Inserting text in front of digits in a string that has delimiters

    I need to insert text from a specific column in front of digits in another column, which is a string of digits with semi-colons as delimiters.

    I've included a sample file to make it easier to follow.

    Column A and B will always be text, and if it matters the length of those characters will vary between 2 and 6.

    Column C and D will always be two-digit numbers separated by semi-colons. The sets of delimited numbers will always be 2-digits between delimiters. The amount of delimited sets of numbers will vary between none at all to a maximum of 13 in each column.

    What I need to get in column E is the text from column A in front of each number in column C, with a space between the text and number. I've typed what that result should look like in column H.

    Then use that same process for column F where the text from column B is in front of each number in column D. I've typed what that result should look like in column I.
    Attached Files Attached Files
    Last edited by Copernicus19; 07-26-2023 at 12:01 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Inserting text in front of digits in a string that has delimiters

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Inserting text in front of digits in a string that has delimiters

    Try this in E2,

    Please Login or Register  to view this content.
    copied down and across.
    Attached Files Attached Files

  4. #4
    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: Inserting text in front of digits in a string that has delimiters

    Try:

    =IFERROR(MAP(A2:A17,C2:C17,LAMBDA(x,y,TEXTJOIN(";",,DROP(x&TEXTSPLIT(y,";"),,-1))))&";","")

    copied ACROSS only.
    Attached Files Attached Files
    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

  5. #5
    Registered User
    Join Date
    07-17-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Inserting text in front of digits in a string that has delimiters

    That works great Fluff13, thank you very much!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Inserting text in front of digits in a string that has delimiters

    Glad to help & thanks for the feedback.

  7. #7
    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: Inserting text in front of digits in a string that has delimiters

    And the other solutions offered??

  8. #8
    Registered User
    Join Date
    07-17-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Inserting text in front of digits in a string that has delimiters

    Was able to go back and try the other solutions offered...

    windknife's works fine as well. I added the IFERROR function you had to Fluff13's and it works great.

    Glenn's your's appears to work but it is missing the required space between the text and the digits. I'm unfamiliar with the MAP function so I'm not sure how that works exactly.

    Either Fluff13 or windknife's solution will work as presented.

  9. #9
    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: Inserting text in front of digits in a string that has delimiters

    Easily fixed, FWIW:

    =IFERROR(MAP(A2:A17,C2:C17,LAMBDA(x,y,TEXTJOIN(";",,DROP(x&" "&TEXTSPLIT(y,";"),,-1))))&";","")

    Do take the time to respond to ALL who helped. It is basic courtesy.



    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Extracting text string from cell with no delimiters
    By MrRAMMounts in forum Excel General
    Replies: 20
    Last Post: 02-26-2023, 12:12 PM
  2. Macro to split text string based on its various structure/delimiters
    By Velehrad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2020, 02:52 PM
  3. Macro to split text string based on its various structure/delimiters
    By Velehrad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2020, 11:24 PM
  4. Extract string of text in the middle of 2 delimiters
    By MoldyBread in forum Excel General
    Replies: 3
    Last Post: 05-07-2018, 07:21 AM
  5. Replies: 2
    Last Post: 04-09-2014, 11:48 AM
  6. [SOLVED] How to remove dot(s) .. or ... in front of text string, not in a middle
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-23-2013, 05:45 PM
  7. [SOLVED] Extracting Text from a string of Text & Digits of variable length
    By hastex in forum Excel General
    Replies: 6
    Last Post: 06-06-2012, 09:11 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