How to Fix Commas in Data Using Excel Power Query

Share
How to Fix Commas in Data Using Excel Power Query

When your Excel data has multiple values crammed into a single cell — like office locations separated by commas — sorting and filtering become impossible. Power Query can split those values into separate rows, giving you clean, usable data.

The Problem: Comma-Separated Values in One Cell

Consider a table with employee names, office locations, and departments. Some employees work from multiple offices, and those offices are listed in a single cell separated by commas (e.g., "Atlanta, Paris, Cleveland"). You can't properly filter or sort by individual office when multiple values share a cell.

Excel spreadsheet with employee data showing multiple offices separated by commas in the Offices column
The problem: multiple office locations crammed into single cells, separated by commas

Loading the Data into Power Query

First, format the data as a table if it isn't already. Then go to the Data tab and click From Table/Range. This opens the Power Query Editor with the table loaded.

Power Query Editor showing the employee data table loaded with the Offices column containing comma-separated values
The data loaded in Power Query Editor — ready for transformation

Splitting the Commas into Separate Rows

Select the Offices column, then go to Split Column > By Delimiter. Choose Comma as the delimiter. Under "Split at," select Each occurrence of the delimiter. Then expand Advanced options and choose Split into Rows (not columns). Click OK.

Split Column by Delimiter dialog in Power Query showing Comma selected and Each occurrence of the delimiter option
Split by comma at each occurrence — the key step that separates values into individual rows

The Result: Clean, Individual Rows

Each comma-separated office now has its own row. An employee with three offices now appears in three rows — one per office. This makes sorting, filtering, and PivotTable analysis straightforward.

Excel table showing the result after Power Query split — each office on its own row with employee data duplicated
After the split: each office gets its own row — Chris Menard now appears three times, once for each office

Fixing Leading Spaces

After splitting, some values may have a leading space (e.g., " Paris" instead of "Paris"). In the Power Query Editor, right-click the Offices column and select Transform > Trim. This removes any extra spaces from the beginning and end of each value.

Refreshing the Data

When the source data changes — like adding a new employee or updating office assignments — right-click the output table and choose Refresh. Power Query re-runs the transformation automatically.

Final Excel table with Queries and Connections panel showing 32 rows loaded from the Power Query transformation
The final result in Excel with the Queries & Connections panel showing the active query
How to Remove Duplicates Running Left to Right in Excel Using Power Query
Removing Duplicates Using Power Query
Copilot for Excel: Transforming Complex Data with Advanced Delimiter Separation
Speed Up Data Entry and Accuracy with Excel Data Validation Lists

Read more

Copilot Skills in PowerPoint - Live Stream on October 20, 2026

Copilot Skills in PowerPoint - Live Stream on October 20, 2026

𝗠𝗼𝘀𝘁 𝗣𝗼𝘄𝗲𝗿𝗣𝗼𝗶𝗻𝘁 𝘂𝘀𝗲𝗿𝘀 𝗸𝗻𝗼𝘄 𝗖𝗼𝗽𝗶𝗹𝗼𝘁 𝗰𝗮𝗻 𝗰𝗿𝗲𝗮𝘁𝗲 𝘀𝗹𝗶𝗱𝗲𝘀. 𝗙𝗮𝗿 𝗳𝗲𝘄𝗲𝗿 𝗸𝗻𝗼𝘄 𝗮𝗯𝗼𝘂𝘁 𝘁𝗵𝗲 𝟴 𝗯𝘂𝗶𝗹𝘁-𝗶𝗻 𝗖𝗼𝗽𝗶𝗹𝗼𝘁 𝗦𝗸𝗶𝗹𝗹𝘀 𝘁𝗵𝗮𝘁 𝗰𝗮𝗻 𝗰𝗼𝗺𝗽𝗹𝗲𝘁𝗲𝗹𝘆 𝗰𝗵𝗮𝗻𝗴𝗲 𝗵𝗼𝘄 𝘆𝗼𝘂 𝗯𝘂𝗶𝗹𝗱, 𝗶𝗺𝗽𝗿𝗼𝘃𝗲, 𝗮𝗻𝗱 𝗽𝗿𝗲𝘀𝗲𝗻𝘁 𝗮 𝗱𝗲𝗰𝗸. Join me live on October 20, 2026, at Noon Eastern as I demonstrate each Copilot Skill and show practical ways to use them in your presentations. PDF of the 8 Copilot Skills in Pow

By Chris Menard