Replace last character

  • Thread starter Thread starter jfr
  • Start date Start date
J

jfr

I need to replace the last character in a cell with another character.
For example, if I have 1011, 1012, and 1013 and I want to replace al
instances of the 1 in 1011 with a, which would make it now 101a, an
replace 1012 with 101b, etc. How would I do that
 
Just a small error in previous posting Here is the correct formula
=REPLACE(A1,LEN(A1),1,IF(RIGHT(A1,1)="1","A","B"))
 
If the sequence a,b,c,... holds:

=REPLACE(A1,LEN(A1),1,CHAR(RIGHT(A1)+96))

Otherwise:

=REPLACE(A1,LEN(A1),1,INDEX({"a","b",...},--RIGHT(A1)))
 
How far does "etc." extend?

You show 1011, 1012 & 1013.

Do you have 26 of these with a new letter replaced in each one?

Assuming numbers are in A1:A26

In B1 enter =LEFT(A1,3)&CHAR(ROW()+96)

Copy down to B26

Copy/Paste Special(in place)>Values

Gord Dibben Excel MVP
 
Back
Top