Substitute characters in one column with characters in another column

gravanoc

Active Member
Joined
Oct 20, 2015
Messages
351
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I'm looking for a dynamic formula whose purpose is to replace accented characters in names with non-accented characters. The potential accented characters are in column D and their replacements are in column E. I want to avoid using VBA and, because the list of accented characters might grow in the future, I'd prefer a formula that adapts to new additions, so it wouldn't be a bunch of nested SUBSTITUTEs.

Ex: Aarón Gómez would become Aaron Gomez by referencing these columns.
1682156481693.png
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can use the LAMBDA function to create a function to do what you want.

Open a new workbook. Go to the Formulas tab, and click on "Define Name". For the Name put "ReplaceChars" (no quotes). In the Refers to: box put:

Excel Formula:
=LAMBDA(str,table,out,
  IF(str="",out,
    ReplaceChars(MID(str,2,LEN(str)-1),
                 table,
                 out&IFERROR(VLOOKUP(LEFT(str),table,2,0),LEFT(str))
    )
  )
 )


Click OK.

Now you can use the function like this:

Book2
ABCDE
1Accented LetterEnglish LetterOriginalChanged
2óoAarón GómezAaron Gomez
3áaJuanita CardeñoJuanita Cardeno
4ñn
5ÑN
Sheet3
Cell Formulas
RangeFormula
E2:E3E2=ReplaceChars(D2,SwapTable,"")
Named Ranges
NameRefers ToCells
SwapTable=Sheet3!$A$2:$B$5E2:E3


I named the table in A2:B5 SwapTable, so that if you ever want to update the table, you can do so and not have to change the formulas. For more information about LAMBDA, see LAMBDA function - Microsoft Support
 
Upvote 0
Solution

Forum statistics

Threads
1,224,575
Messages
6,179,637
Members
452,934
Latest member
Jdsonne31

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