+ Reply to Thread
Results 1 to 3 of 3

Remove characters from string from the right after 4 characters

  1. #1
    Registered User
    Join Date
    05-10-2017
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    1

    Remove characters from string from the right after 4 characters

    Hello,

    I have a column of strings as such:

    ADJRGST1.0102040042.LST
    ADPSL01.T34.0929091855.LST
    CARCK11.T2298.0106094338.LST
    ILPPR01.T2286.0110103449.LST

    Using the first line as an example:
    Starting from the right, I need to keep the first 4 characters (.LST), remove the next 11 characters (.0102040042) and keep the rest (ADJRGST1)

    So my end result would be ADJRGST1.LST

    I feel that it's easy because ALL of my cell strings will have the same character count to keep and remove starting from the right and I'm just struggling to find the correct function syntax.

    Any help/guidance would be greatly appreciated.

    Thx!
    Dave

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Remove characters from string from the right after 4 characters

    =left(a1,len(a1)-15)&right(a1,4)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    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
    43,996

    Re: Remove characters from string from the right after 4 characters

    =LEFT(A1,LEN(A1)-15)&RIGHT(A1,4)

    or (if they're all.LST

    =LEFT(A1,LEN(A1)-15)&".LST"
    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

+ 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. VBA to remove characters from a string
    By ed67 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2015, 12:46 PM
  2. [SOLVED] VBA, remove all characters within a string, except numerical characters and full stops
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 09:24 PM
  3. [SOLVED] How to remove certain characters from a text string
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-05-2013, 02:05 PM
  4. [SOLVED] VBA Remove First 10 Characters From string
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2013, 08:22 AM
  5. [SOLVED] Remove certain characters from the end of a string only
    By mini_dutch28 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-20-2012, 01:04 PM
  6. Remove characters in a string.
    By jncswe in forum Excel General
    Replies: 2
    Last Post: 09-10-2010, 07:26 AM
  7. Remove Characters From Right of String
    By milagros in forum Excel General
    Replies: 11
    Last Post: 12-26-2009, 12:01 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