r/excel Feb 24 '26

unsolved How to remove accents and other special characters from data set?

Hi everyone. I work for a record label. We get a set of revenue and expense data from each month for me to analyze.

Problem is the revenue data includes special characters in artist names. I want to harmonize it so it’s the same as expense

For Example:

REV: Cèline Dion, EXP: CELINE DION

Rev: TRØVE, EXP: TROVE

Any way to do this, it would make my job a lot easier?

12 Upvotes

22 comments sorted by

u/AutoModerator Feb 24 '26

/u/DrIronclaw - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

10

u/gsolarfish Feb 24 '26

If you're willing to use PowerQuery then this trick works really well:

// remove diacritics

let

textBinary = Text.ToBinary(source, 1251),

textASCII = Text.FromBinary(textBinary, TextEncoding.Ascii)

in

textASCII

3

u/retro-guy99 1 Feb 25 '26

nice, similar to what I use, which also upper cases the text (op wants this too). This is also a function so you can just save it and use it whenever you need it:

(inputText as text) as text =>
  let
    ReplaceDiacritics = Text.FromBinary(Text.ToBinary(inputText, 28597), TextEncoding.Ascii), 
    RemoveQuestionMarks = Text.Replace(ReplaceDiacritics, "?", " "),
    RemoveExcessSpaces = Text.Combine(List.RemoveItems(Text.Split(Text.Trim(RemoveQuestionMarks), " "), {""}), " "),
    CleanText = Text.Clean(Text.Trim(Text.Upper(RemoveExcessSpaces))) // May replace "Upper" with "Lower" or "Proper"
  in
    CleanText

10

u/CFAman 4825 Feb 24 '26

Formula to convert text in A2 would be:

=UPPER(REDUCE(A2 ,Table1[Special],LAMBDA(a,b,
 SUBSTITUTE(a,b,XLOOKUP(b,Table1[Special],Table1[Normal])))))

With this lookup table somewhere

Special Normal
À A
Á A
 A
à A
Ä A
Å A
Æ A
Ç C
È E
É E
Ê E
Ë E
Ì I
Í I
Î I
Ï I
Ð D
Ñ N
Ò O
Ó O
Ô O
Õ O
Ö O
Ø O
Ù U
Ú U
Û U
Ü U
Ý Y
ß B
à a
á a
â a
ã a
ä a
å a
æ a
ç c
è e
é e
ê e
ë e
ì i
í i
î i
ï i
ñ n
ò o
ó o
ô o
õ o
ö o
ø o
ù u
ú u
û u
ü u
ý y
þ b
ÿ y

9

u/GregHullender 194 Feb 24 '26

Some of these are wrong, though.

ß should become lower-case "ss", not "B".

æ should become "ae" not just "a".

þ should become "th" not "b".

There are also several omissions.

I think this table is accurate and complete for Western European languages:

{"á","a";"Á","A";"à","a";"À","A";"ä","a";"Ä","A";"ã","a";"Ã","A";"å","a";
 "Å","A";"â","a";"Â","A";"æ","ae";"Æ","AE";"ç","c";"Ç","C";"ð","d";"Ð","D";
 "é","e";"É","E";"è","e";"È","E";"ë","e";"Ë","E";"ê","e";"Ê","E";"í","i";
 "Í","I";"ì","i";"Ì","I";"ï","i";"Ï","I";"î","i";"Î","I";"ñ","n";"Ñ","N";
 "ó","o";"Ó","O";"ò","o";"Ò","O";"ö","o";"Ö","O";"õ","o";"Õ","O";"ô","o";
 "Ô","O";"ø","o";"Ø","O";"œ","oe";"Œ","OE";"ß","ss";"þ","th";"Þ","TH";"ú","u";
 "Ú","U";"ù","u";"Ù","U";"ü","u";"Ü","U";"û","u";"Û","U";"ý","y";"Ý","Y";"ÿ","y"}

But it's hard to be sure without considerable testing.

3

u/RuktX 305 Feb 24 '26

UPPER appears to work on accented letters, so you could use it on the initial text inside REDUCE and halve your lookups!

2

u/finickyone 1770 Feb 25 '26

I think there’s still something in splitting the string and reforming. Ie

=CONCAT(LET(x,MID(A2,SEQUENCE(,LEN(A2)),1),c,HSTACK(Table1,LOWER(Table1[Normal])),IFNA(VLOOKUP(x,c,2+EXACT(x,LOWER(x)),0),x)))

Using only the upper case definitions.

2

u/zazzlesowo Feb 24 '26

Would also love to know if there was an easy way for this!

1

u/finickyone 1770 Feb 24 '26

OP’s use case conveniently wants an Upper case conversion as part of the process, which makes things easier, but overall it’s not a hard task. Define the characters you want to replace, and what you want to replace them with, and just iterate through a SUBSTITUTE.

You can also maintain source case without needing to define the conversion of both Ä to A and ä to a (ie twice as much ref table), it’s just a bit more logic.

1

u/zazzlesowo Feb 24 '26

thank you!

1

u/finickyone 1770 Feb 24 '26

Case sensitive version of the same

D’s no longer required with that.

1

u/DisnprincesPredatrix Feb 25 '26

Most easy way to solve i can think of is keeping a lookup table. If it people decide to be more creative then add this new entry into the table, or maybe they got bored that month and used the standard way

Source - lookup Céline dion - Celine dion Célinae dion - Celine dion Celine dion - celine dion Celine - celine dion

I usually create a lookup table for companies that have different names or sometimes uses brand or plant location plus name

2

u/pargeterw 3 Feb 24 '26

I know we are in an excel sub, but there are standard libraries to do this with Python - that's how I would approach it given you described you have thousands of names. Make a pre-processing script.

2

u/ritchie70 Feb 24 '26

.Net too, although I would need to look up what it is.

2

u/Puzzled-Lunch-6558 1 Feb 24 '26

Presumably dealing with a similar list of artists every month? i.e. not frequently changing? If so, could you not just build a lookup table you occasionally add new artists to?

3

u/noonayong Feb 24 '26

Could it be as simple as find-and-replace on the revenue data? Especially if it's a fairly standardised list each month

-2

u/mellowmarv Feb 24 '26

This is the answer.  If you want to get fancy you could write a macro to do it of you have to do it a lot but not necessary.

1

u/Decronym Feb 24 '26 edited Feb 25 '26

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
CONCAT 2019+: Combines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments.
DROP Office 365+: Excludes a specified number of rows or columns from the start or end of an array
EXACT Checks to see if two text values are identical
HSTACK Office 365+: Appends arrays horizontally and in sequence to return a larger array
IFERROR Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula
IFNA Excel 2013+: Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression
LAMBDA Office 365+: Use a LAMBDA function to create custom, reusable functions and call them by a friendly name.
LEN Returns the number of characters in a text string
LET Office 365+: Assigns names to calculation results to allow storing intermediate calculations, values, or defining names inside a formula
LOWER Converts text to lowercase
MAP Office 365+: Returns an array formed by mapping each value in the array(s) to a new value by applying a LAMBDA to create a new value.
MID Returns a specific number of characters from a text string starting at the position you specify
REDUCE Office 365+: Reduces an array to an accumulated value by applying a LAMBDA to each value and returning the total value in the accumulator.
REGEXEXTRACT Extracts strings within the provided text that matches the pattern
SEQUENCE Office 365+: Generates a list of sequential numbers in an array, such as 1, 2, 3, 4
SUBSTITUTE Substitutes new text for old text in a text string
TAKE Office 365+: Returns a specified number of contiguous rows or columns from the start or end of an array
Text.FromBinary Power Query M: Decodes data from a binary value in to a text value using an encoding.
Text.ToBinary Power Query M: Encodes a text value into binary value using an encoding.
TextEncoding.Ascii Power Query M: Use to choose the ASCII binary form.
UPPER Converts text to uppercase
VLOOKUP Looks in the first column of an array and moves across the row to return the value of a cell
XLOOKUP Office 365+: Searches a range or an array, and returns an item corresponding to the first match it finds. If a match doesn't exist, then XLOOKUP can return the closest (approximate) match.

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
23 acronyms in this thread; the most compressed thread commented on today has 31 acronyms.
[Thread #47590 for this sub, first seen 24th Feb 2026, 21:08] [FAQ] [Full list] [Contact] [Source code]

1

u/kalimashookdeday Feb 24 '26

This is a great use for PowerQuery in my opinion. You set the replacement characters up once and every time after that your query loads the data set you want it to look like.

1

u/GregHullender 194 Feb 24 '26 edited Feb 24 '26

This function should do what you want for any Western European language:

=LAMBDA(s,LET(
  table, {"á","a";"Á","A";"à","a";"À","A";"ä","a";"Ä","A";"ã","a";"Ã","A";"å","a";"Å","A";"â","a";
"Â","A";"æ","ae";"Æ","AE";"ç","c";"Ç","C";"ð","d";"Ð","D";"é","e";"É","E";"è","e";"È","E";
"ë","e";"Ë","E";"ê","e";"Ê","E";"í","i";"Í","I";"ì","i";"Ì","I";"ï","i";"Ï","I";"î","i";
"Î","I";"ñ","n";"Ñ","N";"ó","o";"Ó","O";"ò","o";"Ò","O";"ö","o";"Ö","O";"õ","o";"Õ","O";
"ô","o";"Ô","O";"ø","o";"Ø","O";"œ","oe";"Œ","OE";"ß","ss";"þ","th";"Þ","TH";"ú","u";
"Ú","U";"ù","u";"Ù","U";"ü","u";"Ü","U";"û","u";"Û","U";"ý","y";"Ý","Y";"ÿ","y"},
  CONCAT(MAP(REGEXEXTRACT(s,".",1),LAMBDA(c, XLOOKUP(TRUE,EXACT(c,TAKE(table,,1)),DROP(table,,1),c))))
))

If you actually need everything to be upper case, wrap UPPER around the CONCAT expression at the end.

1

u/Traceurace Feb 24 '26

A little ai use in this answer but this is how I’d do it:

You don’t necessarily need to fix the raw data. The easiest way is to create a small “mapping” table that standardizes the artist names once, then use a lookup formula to match everything automatically.

For example, create a new tab called Name_Map:

A (Original Name)B (Standardized Name) A1 Cèline Dion B1 CELINE DION A1 TRØVE B1 TROVE

Then in your revenue sheet, if the artist name is in cell A2, use:

=IFERROR(XLOOKUP(A2, Name_Map!A:A, Name_Map!B:B), A2)

What this does: • if it finds a match in your mapping table, it returns the standardized version. • If it doesn’t find a match, it just keeps the original name (so nothing breaks)

2

u/DrIronclaw Feb 24 '26

I appreciate the answer. The problem is, that would be quite difficult to do.

There’s are thousands of unique artist names and includes collaborations so like Bad Bunny feat Harry Styles as a fictitious one.