How to Combine Duplicate Values into Another Column in Excel
Question details
The user needs to group duplicate values in one column and merge their corresponding text or numbers into a new, separate column.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Consolidating datasets where multiple rows share the same identifier but have different related values that must be combined into a single cell.
- Observed behavior
- Duplicate identifiers are grouped together, and their associated values are concatenated into a single cell in a corresponding column.
Verify your Excel version before proceeding, as modern functions like GROUPBY and FILTER are only available in Microsoft 365 and Excel 2021 or later, while older versions will require traditional array formulas.
Use the GROUPBY and TEXTJOIN Formula (For Newer Excel Versions)
This is the most efficient method for Microsoft 365 users, utilizing the modern GROUPBY function to instantly consolidate data in a single step.
The GROUPBY function, combined with LAMBDA and TEXTJOIN, can dynamically scan your range, find duplicates, and merge the associated values without needing helper columns.
Click on an empty cell (e.g., C2) where you want the new grouped output to begin.
Type the formula: =GROUPBY(A2:A6,B2:B6,LAMBDA(a,TEXTJOIN("",TRUE,a)),,0)
Press Enter. This formula groups the values in column A and combines the corresponding values from column B into a spilled array.
Use TEXTJOIN with IF (For Compatible Excel Versions)
A highly reliable array formula approach for Excel versions that support TEXTJOIN (Excel 2019 and later) but lack the newer GROUPBY function.
Use CONCAT and FILTER Formulas
Leverages dynamic arrays to quickly filter related values and concatenate them without the complexity of LAMBDA functions.
Easily Consolidate Duplicate Data with WPS Spreadsheet
WPS Office offers robust formula support, allowing you to combine duplicate records and manage large datasets efficiently. It fully supports advanced text and array functions, providing a seamless data processing experience.
- 1. Open your data file: Launch WPS Spreadsheet and open the document containing your duplicate records.
- 2. Select the target cell: Click the cell where you want the combined text or numbers to appear.
- 3. Enter a combination formula: Input the TEXTJOIN and IF array formula or the FILTER formula to map out your specific ranges.
- 4. Apply and drag: Press Enter to evaluate the formula, then use the fill handle to apply it to the remaining rows in your column.

Frequently Asked Questions
Why is my TEXTJOIN formula showing a #NAME? error?
This error occurs if you are using an older version of Excel (like Excel 2016 or earlier) that does not support the TEXTJOIN function. You will need to upgrade your software, use WPS Office, or rely on a VBA macro to combine text.
Do I need to press Ctrl+Shift+Enter when using these combination formulas?
In newer versions of Excel that support Dynamic Arrays, simply pressing Enter is sufficient. However, if you are using older versions with the IF array method, you must press Ctrl+Shift+Enter to evaluate the array properly.
How do I separate the combined values with a comma instead of having no space?
You can change the delimiter in the first argument of the TEXTJOIN formula. For example, instead of using TEXTJOIN("",TRUE,a), change it to TEXTJOIN(", ",TRUE,a) to add a comma and a space between each combined value.
Is it possible to combine duplicate values without using complex formulas?
Yes, you can use Power Query as an alternative. Select your data, go to the Data tab, click 'From Table/Range', group the data by your identifier column, and use a custom column to combine the specific rows.




