Substitute characters in one column with characters in another column

gravanoc

Active Member
Joined
Oct 20, 2015
Messages
348
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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,215,013
Messages
6,122,690
Members
449,092
Latest member
snoom82

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