Table of Contents
Combining rows with the same ID in Excel refers to the process of merging multiple rows of data that share a common identifier into a single row. This can be achieved by using the “Consolidate” function in Excel, which allows you to select the data range and specify the criteria for combining the rows. The resulting merged row will contain all the data from the original rows, making it easier to analyze and manage the data. This feature is particularly useful when working with large datasets and can save time and effort in organizing and summarizing data.
Excel: Combine Rows with Same ID
You can use the Consolidate function in the Data tab in Excel to combine rows with the same ID.

The following example shows how to use this function in practice.
Example: How to Combine Rows with Same ID in Excel
Suppose we have the following dataset in Excel that contains information about sales made by various employees at some company:

Notice that several of the rows have the same value in the ID column.
Suppose we would like to combine the rows with the same ID values and simply sum the values in the Sales column.
To do so, we can make sure cell E1 is active and then click the Data tab along the top ribbon and then click the icon called Consolidate within the Data Tools group:

In the new window that appears, choose Sum as the function, then type A1:C11 as the range.
Then check the boxes next to Use labels in Top Row and Left column:

Once you click OK, the rows with the same ID values will be combined and the values in the Sales column will be summed:

The new dataset combines the rows from the original dataset with the same ID values and calculates the sum of sales for each ID.
For example, the employee with the ID value of A001 had individual sales values of 7, 5 and 3.
The same calculation is performed for each unique ID value.
Note that you can also consolidate the data using a different summary statistic (e.g. count, average, max, etc.) by choosing a different value from the dropdown menu for Function within the Consolidate window.
The following tutorials explain how to perform other common tasks in Excel:
Cite this article
stats writer (2024). How can I combine rows with the same ID in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-combine-rows-with-the-same-id-in-excel/
stats writer. "How can I combine rows with the same ID in Excel?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-combine-rows-with-the-same-id-in-excel/.
stats writer. "How can I combine rows with the same ID in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-combine-rows-with-the-same-id-in-excel/.
stats writer (2024) 'How can I combine rows with the same ID in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-combine-rows-with-the-same-id-in-excel/.
[1] stats writer, "How can I combine rows with the same ID in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I combine rows with the same ID in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
