Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

Power Query Function to Remove Accents in Excel

Power Query
Reading time: 2 minutes
Views: 4,499

In this article, you’ll find a ready-to-use Power Query custom function that removes diacritics (accents) from your text, so École becomes Ecole, Łódź becomes Lodz, and so on. This is essential for robust matching, deduplication, and URL slugs.

Power Query vs VBA

We previously showed a similar approach in VBA. However, classic VBA techniques often rely on the extended ASCII table and run into limits beyond character code 255. That means characters such as ż, ł, or ń aren’t handled reliably with simple ASCII mappings. Power Query (M) works with Unicode and makes this kind of cleanup much more dependable.

ASCII table limitations compared to Unicode

Because many European characters exceed code 255, Power Query is the recommended option for normalizing text for joins, search, or key generation.

Code overview

The function builds a two-column mapping (accented → unaccented) and applies it across the characters of your text. Conceptually:

  1. A list of target letters to return (A, C, E, L, N, O, S, Z, etc.).
  2. All accented variants that should map to each target letter (á, à, ä → a; Ą → A; ł → l; etc.).
(MyText as text) =>
let
 ListAccents = 
 {
 {"à","a"},
 {"á","a"},
 {"â","a"},
 {"ã","a"},
 {"ä","a"},
 {"å","a"},
 {"è","e"},
 {"é","e"},
..........
 {"ś","s"},
 {"ż","z"},
 {"ź","z"},
 {"Ą","A"},
 {"Ć","C"},
 {"Ę","E"},
 {"Ł","L"},
 {"Ń","N"},
 {"Ś","S"},
 {"Ż","Z"},
 {"Ź","Z"},
 }
in
 Text.Combine(List.ReplaceMatchingItems(Text.ToList(MyText), ListAccents))

How it works:

  • Text.ToList splits MyText into a list of single characters.
  • List.ReplaceMatchingItems replaces each accented character using the mapping list.
  • Text.Combine rebuilds the normalized string.

Download the code

Click the button to download the text version of the custom function.

Download Remove accents function

Setup

  1. Copy the code in the file.
  2. In Excel: Data > Get Data > From Other Sources > Blank Query.
  3. Open the Advanced Editor and paste the code.
  4. Name the query fnRemoveAccents.
Name the function fnRemoveAccents

Use the function

Build your query as usual, then call the function to normalize a text column:

  1. Add Column > Invoke Custom Function.
  2. Select the function query (e.g., fnRemoveAccents).
  3. Choose the source column that contains accented text.
  4. Confirm to create a new normalized column without accents.
Invoke Power Query function to remove accents

Tip: Apply this cleanup early in your queries (right after source and type steps) to make downstream joins, grouping, and matching more reliable.

Related articles

  • DATEDIFF for POWER QUERY
  • Auto Refresh Power Query on Workbook Open

Frédéric LE GUEN

power query, remove

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,813)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,034)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

Power Query Function to Remove Accents in Excel

Reading time: 2 minutes
Views: 4,499

In this article, you’ll find a ready-to-use Power Query custom function that removes diacritics (accents) from your text, so École becomes Ecole, Łódź becomes Lodz, and so on. This is essential for robust matching, deduplication, and URL slugs.

Power Query vs VBA

We previously showed a similar approach in VBA. However, classic VBA techniques often rely on the extended ASCII table and run into limits beyond character code 255. That means characters such as ż, ł, or ń aren’t handled reliably with simple ASCII mappings. Power Query (M) works with Unicode and makes this kind of cleanup much more dependable.

ASCII table limitations compared to Unicode

Because many European characters exceed code 255, Power Query is the recommended option for normalizing text for joins, search, or key generation.

Code overview

The function builds a two-column mapping (accented → unaccented) and applies it across the characters of your text. Conceptually:

  1. A list of target letters to return (A, C, E, L, N, O, S, Z, etc.).
  2. All accented variants that should map to each target letter (á, à, ä → a; Ą → A; ł → l; etc.).
(MyText as text) =>
let
 ListAccents = 
 {
 {"à","a"},
 {"á","a"},
 {"â","a"},
 {"ã","a"},
 {"ä","a"},
 {"å","a"},
 {"è","e"},
 {"é","e"},
..........
 {"ś","s"},
 {"ż","z"},
 {"ź","z"},
 {"Ą","A"},
 {"Ć","C"},
 {"Ę","E"},
 {"Ł","L"},
 {"Ń","N"},
 {"Ś","S"},
 {"Ż","Z"},
 {"Ź","Z"},
 }
in
 Text.Combine(List.ReplaceMatchingItems(Text.ToList(MyText), ListAccents))

How it works:

  • Text.ToList splits MyText into a list of single characters.
  • List.ReplaceMatchingItems replaces each accented character using the mapping list.
  • Text.Combine rebuilds the normalized string.

Download the code

Click the button to download the text version of the custom function.

Download Remove accents function

Setup

  1. Copy the code in the file.
  2. In Excel: Data > Get Data > From Other Sources > Blank Query.
  3. Open the Advanced Editor and paste the code.
  4. Name the query fnRemoveAccents.
Name the function fnRemoveAccents

Use the function

Build your query as usual, then call the function to normalize a text column:

  1. Add Column > Invoke Custom Function.
  2. Select the function query (e.g., fnRemoveAccents).
  3. Choose the source column that contains accented text.
  4. Confirm to create a new normalized column without accents.
Invoke Power Query function to remove accents

Tip: Apply this cleanup early in your queries (right after source and type steps) to make downstream joins, grouping, and matching more reliable.

Related articles

  • DATEDIFF for POWER QUERY
  • Auto Refresh Power Query on Workbook Open
Tags: power queryremove

Frédéric LE GUEN

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net