Replace last character

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
 
N

NH

Just a small error in previous posting Here is the correct formula
=REPLACE(A1,LEN(A1),1,IF(RIGHT(A1,1)="1","A","B"))
 
A

Aladin Akyurek

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)))
 
G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top