Power Query Problems

How to Merge Rows with Duplicate Timestamps in Excel Using Power Query

Elise WilliamsElise Williams Nov 4, 2026 871 views

Question details

The user needs to combine multiple Excel rows that share the same timestamp into a single consolidated row, preserving all nonblank values from the other columns for large datasets.

How to Merge Rows with Duplicate Timestamps in Excel Using Power Query
Product
Excel
Device & OS
not provided
Scenario
Cleaning and consolidating large datasets where identical timestamps span multiple rows with scattered data points.
Observed behavior
Multiple incomplete rows exist for a single timestamp, requiring automated consolidation into one complete row per timestamp.
Before you start

Ensure your dataset is formatted as an Excel Table (Ctrl+T) so that Power Query can easily capture and refresh the data range when new rows are added.

Solution 1Recommended

Consolidate Duplicate Timestamps Using Power Query

Use the Group By feature within Power Query to merge duplicate timestamp rows and aggregate the remaining columns to keep nonblank values.

Power Query is the most efficient tool for handling thousands of records, allowing you to set up rules to group data by specific columns and output a cleaned table.

1
Load Data into Power Query

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

2
Group By Timestamp

Select your timestamp column, navigate to the Transform tab, and click on 'Group By'.

3
Configure Aggregation Settings

In the Group By dialog, select 'Advanced'. Group by your timestamp column, and for the remaining columns, add aggregations using operations like 'Max' or 'Sum' (depending on data type) to ensure nonblank values are retained.

4
Load and Refresh

Go to Home > Close & Load to generate the combined output on a new worksheet. Whenever the source data changes, simply click Data > Refresh All to update the merged table.

Consolidate Duplicate Timestamps Using Power Query
Use a Solution Template: Once your query is built, you can use the workbook as a template. Just paste new data into the input sheet and click Refresh All to automatically generate the output.
WPS Spreadsheet Solution

Consolidate Duplicate Data Easily with WPS Office

WPS Spreadsheet offers powerful built-in tools like Data Consolidate and Pivot Tables to quickly aggregate duplicate rows without needing complex queries.

  1. 1. Open Your Spreadsheet: Launch WPS Spreadsheet and open the file containing your duplicate timestamps.
  2. 2. Select the Consolidate Tool: Click on a blank cell where you want the merged data. Go to the Data tab and select 'Consolidate'.
  3. 3. Configure Consolidation Settings: Choose the appropriate function (e.g., Sum or Max) and select the data range containing your timestamps and values.
  4. 4. Group by the Timestamp Column: Check the box for 'Left column' to ensure the data is grouped by the timestamps, then click OK to instantly generate your merged rows.
Fully compatible with Microsoft Excel file formats (.xlsx, .csv)Built-in Data Consolidate tool for instant data aggregationRich Pivot Table functionality to group timestamps quicklyLightweight, free, and intuitive user interface
microsoft office alternative - wps office

Frequently Asked Questions

How do I update the merged data when new timestamps are added?

Add your new rows to the original source table in Excel. Then, go to the Data tab and click 'Refresh All'. Power Query will automatically process the new records and update your output worksheet.

Why are blank cells overwriting my data when I merge rows?

If columns aren't properly aggregated during the 'Group By' step, Power Query might return blanks. Ensure you use an aggregation function like 'Maximum' in the Group By settings to preserve the nonblank data in those columns.

Can I merge rows with duplicate timestamps without using Power Query?

Yes, you can use Pivot Tables or the Data Consolidate tool to group by the timestamp column and aggregate the values. However, Power Query is highly recommended for creating automated, repeatable workflows on large datasets.