+ Reply to Thread
Results 1 to 4 of 4

formula to replace numbers with specific letters

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    2

    formula to replace numbers with specific letters

    Hi, I'm looking for a formula to replace numbers with letters, but the string of numbers varies and only the numbers before the hyphen need to be changed. Here are some examples;

    1135 would = AACE
    5567 would = EEFG
    23-804 would = BC-804
    111-0535 would = AAA-0535
    801-6654 would = HJA-6654

    Attached is a worksheet with more examples. Thanks in advance.
    Attached Files Attached Files
    Last edited by SPCC; 09-02-2020 at 01:23 PM.

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    4,006

    Re: formula to replace numbers with specific letters

    The formula is really difficult to explain, please see the yellow area in your attachment

    Simple formulas are not easy to complete this task
    1. Completely write VBA code
    2. The solution is custom function formula + formula combination

    HTML Code: 
    Attached Files Attached Files

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: formula to replace numbers with specific letters

    Excel2003 cannot open .xlsx format
    But if you need formula for Excel2003-2010

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(A7,FIND("-",A7&"-")-1),$D$7,$E$7),$D$8,$E$8),$D$9,$E$9),$D$10,$E$10)
    &MID(A7,FIND("-",A7&"-"),9)
    Repeat 10 times of SUBSTITUTE which I only did 4 times

    Excel 2013 or above

    =BASE(SUMPRODUCT(MOD(MID(A7,ROW(A$1:INDEX(A:A,FIND("-",A7&"-")-1)),1)-1,10)+10,36^(FIND("-",A7&"-")-1-ROW(A$1:INDEX(A:A,FIND("-",A7&"-")-1)))),36)&MID(A7,FIND("-",A7&"-"),9)


    Excel 2019 & MS365
    =CONCAT(BASE(MOD(MID(A7,ROW(A$1:INDEX(A:A,FIND("-",A7&"-")-1)),1)-1,10)+10,36))&MID(A7,FIND("-",A7&"-"),9)
    Attached Files Attached Files
    Last edited by Bo_Ry; 09-02-2020 at 02:32 AM.

  4. #4
    Registered User
    Join Date
    10-03-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: formula to replace numbers with specific letters

    Works perfect. Thank you!

+ 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: 15
    Last Post: 02-17-2020, 11:21 AM
  2. [SOLVED] Average numbers after specific letters
    By jher001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2017, 02:08 PM
  3. Formula Finding String with Specific Letters and Numbers
    By jpedges38 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-06-2012, 08:56 PM
  4. [SOLVED] Replace parts of a cell (Numbers and letters)
    By nicdyb in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-19-2012, 08:15 AM
  5. Excel 2007 : Replace numbers by letters
    By pGrim in forum Excel General
    Replies: 4
    Last Post: 05-19-2011, 03:13 AM
  6. Count specific characters with numbers or letters
    By hoppscrouse in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2007, 09:02 AM
  7. [SOLVED] replace the letters (for collumn) & numbers(row no.) of cell reference only
    By al007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2005, 12:50 PM

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