+ Reply to Thread
Results 1 to 4 of 4

Replace "_" with "." and remove Trailing Alpha (where and when applicable)

  1. #1
    Registered User
    Join Date
    11-24-2014
    Location
    Vancouver
    MS-Off Ver
    2013
    Posts
    7

    Replace "_" with "." and remove Trailing Alpha (where and when applicable)

    Hey Guys

    I have a desired condition to replace "_" to "." and to have the A,B be removed where applicable.


    114_3-F-XXX-1586 -- 114.3-F-XXX-1586
    114_3-F-XXX-1586A -- 114.3-F-XXX-1586
    114_3-F-XXX-1586B -- 114.3-F-XXX-1586
    1067-F-XXX-1000 -- 1067-F-XXX-1000
    1067-F-XXX-1000A -- 1067-F-XXX-1000
    1067-F-XXX-1000B -- 1067-F-XXX-1000
    88_9-F-XXX-1586 -- 88.9-F-XXX-1586


    suggestions
    Cheers

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Replace "_" with "." and remove Trailing Alpha (where and when applicable)

    Is it always just A or B, or could it be a C D E etc?

    If it's always just A or B, try

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"_","."),"A --"," --"),"B --"," --")

  3. #3
    Registered User
    Join Date
    11-24-2014
    Location
    Vancouver
    MS-Off Ver
    2013
    Posts
    7

    Re: Replace "_" with "." and remove Trailing Alpha (where and when applicable)

    first of thanks for the reply,..

    SUBSTITUTE(A1,"_",".") works... but

    There could be A --Z and within that cell there could be a combination of other Letters but don't want to change them.. only the ending..

    After the - there will be 4 digits or 5 (5 digit would have the alpha I would like to remove)

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Replace "_" with "." and remove Trailing Alpha (where and when applicable)

    Try

    =SUBSTITUTE(IF(ISERROR(MID(A1,FIND("--",A1)-2,1)+0),REPLACE(A1,FIND("--",A1)-2,1,""),A1),"_",".")

+ 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. replace all defined range names in the sheet that start with "Street" to "Road"
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-04-2016, 08:53 AM
  2. [SOLVED] VBA help needed to remove all "/" then replace with "-" from cell "B3"and "B5"
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 02:11 PM
  3. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  4. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  5. Replies: 1
    Last Post: 09-21-2013, 03:18 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