Change a letter and delete digits in a cell

harriet60

New Member
Joined
Apr 6, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
HI,

Please bare with me - I'm new to the forum and learning excel later in life :)

I have columns of data that follow a similar pattern (always 4 letters to start, followed by a series of numbers).
I need to change the 4th letter (regardless of what it is) to another letter (always the same one).
I also need to remove the first 4 numbers.

I have enclosed an example but basically I need to change ABCD12013456 to ABCR3456.
The letters will always consist of 4 but the numbers may vary - however, it is always the first 4 I need to remove.

Thanks in advance for your help.
 

Attachments

  • example22.JPG
    example22.JPG
    33.6 KB · Views: 7

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Welcome to the Board!

Try this for a value found in cell A1:
Excel Formula:
=LEFT(A1,3) & "R" & MID(A1,9,LEN(A1))
 
Upvote 0
Another option
Excel Formula:
=REPLACE(A2,4,5,"R")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Morning Everyone,

Is it possible to add an 'IF' function to this please?

In another column I have a list of cities. I want to state if cell = MADRID, apply the formula, if not, return the original number.
I've tried IF(F17="MADRID",LEFT(G17,3) & "R" & MID(G17,9,LEN(G17),G17)) but the response is 'too many arguments'.
Screenshot updated.
 

Attachments

  • example22.JPG
    example22.JPG
    40 KB · Views: 5
Upvote 0
How about
Excel Formula:
=IF(F17="Madrid",REPLACE(G17,4,5,"R"),G17)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top