Power Query Problems

Identify Similar Duplicate File Names in Excel Power Query

Muhammad TalhaMuhammad Talha Nov 10, 2026 869 views

Question details

The user needs a method to identify similar, but not exactly identical, file names within specific sites in a large Excel dataset.

How to Identify Similar Duplicate File Names by Site in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Cleaning a large dataset where duplicate file names might have slight variations, such as underscores, dates, version numbers, or words like 'Final'.
Observed behavior
Standard duplicate detection tools fail because they require exact character-by-character text matches, missing files that are functional duplicates but have minor naming variations.
Before you start

Before beginning, establish clear normalization rules for your file names (e.g., deciding whether 'v1' and 'v2' count as duplicates) to prevent false positives during the matching process.

Solution 1Recommended

Use Power Query Fuzzy Matching

Leverage Power Query's FuzzyNestedJoin feature to find non-exact matches based on similarity thresholds.

Fuzzy matching allows you to join tables based on approximate matches rather than exact matches. This is the most efficient way to catch file names that differ only by minor typos, underscores, or missing spaces without writing incredibly complex nested formulas.

1
Load data into Power Query

Select your data range in Excel, go to the 'Data' tab, and click 'From Table/Range' to open the Power Query Editor.

2
Merge the query with itself

In the Home tab of the Power Query Editor, click 'Merge Queries'. In the dialog box, select the same table from the dropdown menu to merge the table with itself.

3
Enable fuzzy matching

Select the 'Site' and 'File Name' columns for both tables. Check the box labeled 'Use fuzzy matching to perform the merge'.

4
Adjust fuzzy matching options

Expand the Fuzzy matching options. Set 'Ignore case' and 'Ignore spaces' to true. Adjust the 'Similarity Threshold' (e.g., 0.8) to balance precision and recall.

5
Identify duplicates

Click 'OK', then expand the merged column to count the matched rows. Any row with a match count greater than 1 has similar duplicates.

Use Power Query Fuzzy Matching
Understanding Thresholds: A similarity threshold of 1.0 requires an exact match, while 0.0 matches everything. Start at 0.8 and adjust based on the specific variations in your dataset.
Free Microsoft Office alternative

Discover WPS Office for Your Data Management

If you are managing large datasets and looking for a lightweight, free alternative to Microsoft Office, WPS Office provides excellent spreadsheet functionalities. It offers seamless format compatibility, a familiar user interface, and powerful data processing capabilities without the heavy subscription fees.

Free, lightweight, and fast office suiteHighly compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Rich set of built-in formulas for data cleaning and text extractionFamiliar user interface for a seamless, zero-learning-curve migration
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Excel's built-in Remove Duplicates feature work for this?

Excel's standard 'Remove Duplicates' tool requires exact character-by-character matches. It cannot recognize that 'File_v1.pdf' and 'File_final.pdf' are conceptually the same file, which is why fuzzy matching or text normalization is required.

What is a good similarity threshold for fuzzy matching file names?

A threshold between 0.75 and 0.85 is typically a good starting point. You may need to lower it if your file names have drastic variations, or raise it closer to 1.0 to prevent false positives where distinct files are wrongly grouped together.

Should I ignore file extensions when comparing duplicates?

Yes. It is highly recommended to strip the file extension (e.g., .pdf or .xlsx) using functions like TEXTBEFORE or Power Query delimiters before running any comparison, as variations in extensions can skew similarity scores.