Power Query Problems

Compare Comma-Separated Lists with an Excel Report Using Power Query

Steven ParkerSteven Parker Dec 2, 2026 868 views

Question details

Compare letters listed in a comma-separated cell with letters on separate report rows for the same control number, and return a completeness indicator.

Compare Comma-Separated Lists with an Excel Report Using Power Query
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
One table contains a control number and a comma-separated list of expected letters; a second report contains one letter per row for each control number.
Observed behavior
The desired result is Yes when every expected letter appears in the report for its control number, and No when at least one is missing.
Before you start

Make sure both sources have a control-number column and that the first source has a comma-separated letter list. Check that control numbers are stored consistently, especially if leading zeros matter.

Solution 1Recommended

Compare both tables and summarize missing letters in Power Query

Use a left outer merge to check every expected letter against the report, then count missing letters for each control number.

For these steps, name the control-number columns Control, the first table's list column LetterList, and the report's letter column Letter. The comparison checks whether expected letters are missing; extra letters in the report do not change the result.

1
Import both tables

Select each source range in Excel, choose Insert > Table, and then use Data > From Table/Range to open each table in Power Query.

2
Split the expected letters into rows

In the first query, select LetterList and choose Home > Split Column > By Delimiter. Select Comma, open Advanced options, and choose Split into Rows. Rename the resulting column Letter.

3
Standardize both queries

Set Control and Letter to the Text data type in each query. Select each column and choose Transform > Format > Trim. Remove blank letter rows, and use Transform > Format > Uppercase on both Letter columns if letter case should not affect matching.

4
Remove duplicate report pairs

In the report query, select both Control and Letter, then choose Home > Remove Rows > Remove Duplicates. This prevents duplicate report rows from multiplying matches.

5
Merge on both columns

In the expected-letters query, choose Home > Merge Queries. Select the report query and select Control and then Letter in the same order in both tables. Choose Left Outer as the join type, then expand the merged column and select Letter with the column-name prefix enabled. Rename the expanded column Report.Letter if necessary.

6
Flag and inspect missing letters

Choose Add Column > Custom Column, name it Missing, and enter if [Report.Letter] = null then 1 else 0. Set Missing to Whole Number. To see the missing letters separately, right-click this query in the Queries pane, select Reference, and filter Missing to 1.

7
Return a result for each control

In the original merged query, choose Home > Group By. Group by Control and use the Sum operation on Missing, naming the result MissingCount. Choose Add Column > Custom Column and enter if [MissingCount] = 0 then "Yes" else "No". Select Home > Close & Load to return the results to Excel.

Compare both tables and summarize missing letters in Power Query
Controls with empty lists: Removing blank letter rows excludes controls that have no expected letters. Decide separately whether those controls should be reported as complete or left without a result.
Free Microsoft Office alternative

Work with Excel Reports in WPS Spreadsheet

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files and move everyday report work to WPS, although it does not fix Microsoft Excel Power Query issues.

Review and edit spreadsheet reports in a familiar interfaceOpen and save compatible Microsoft Excel XLSX filesWork with control numbers and letter lists in spreadsheetsMove everyday spreadsheet work from Microsoft Office with minimal adjustment
microsoft office alternative - wps office

Frequently Asked Questions

How can I see which letters are missing?

In Power Query, right-click the merged query and select Reference. Filter the Missing column to 1 to display the control numbers and expected letters that did not match.

Why do matching letters appear as missing?

Check that Control and Letter use the same data types in both queries. Use Transform > Format > Trim to remove surrounding spaces, and apply Uppercase to both letter columns if case should be ignored.

Will an extra letter in the report make the result No?

No. The left outer merge checks whether each expected letter appears in the report. Extra report letters are not counted as missing.

How do I update the results after the reports change?

After updating the source tables, select Data > Refresh All in Excel to rerun the queries and update the loaded results.