How to Concatenate Child-Row Values into Parent Rows in Excel
Question details
The user needs to group parent and child records together and combine multiple child-row values into a single parent row.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing hierarchical data where child components and quantities must be systematically merged into their respective parent item rows.
- Observed behavior
- Parent and child records currently exist in separate rows, and the goal is to flatten the child data into the parent records using automated formulas.
Ensure you are using a version of Excel that supports dynamic array functions (such as Microsoft 365 or Excel 2021), as functions like LET, UNIQUE, and VSTACK are required for the formula-based solution.
Use Advanced Dynamic Array Functions
Create a dynamic, automated solution using a combination of LET, UNIQUE, FILTER, REDUCE, and TEXTJOIN to group and concatenate child rows.
This approach uses the LET function to define variables, making complex formulas easier to read and process. By combining UNIQUE to find parent groups and FILTER with TEXTJOIN, you can aggregate child data seamlessly.
Use the UNIQUE function on your parent ID column to extract a distinct, deduplicated list of parent records.
Apply the FILTER function to isolate child records that match each unique parent ID.
Wrap the FILTER function inside TEXTJOIN to combine the child components and quantities into a single text string, separated by commas or line breaks.
Use REDUCE, VSTACK, and HSTACK to iterate through the parent groups and output the combined parent and concatenated child arrays dynamically into your worksheet.

Use Power Query to Group and Concatenate
If your Excel version lacks dynamic arrays, Power Query offers a robust visual interface for grouping and concatenating rows without complex formulas.
Manage Complex Data Hierarchies with WPS Spreadsheet
WPS Spreadsheet provides comprehensive support for advanced data processing, allowing you to seamlessly manage parent-child records, utilize advanced functions, and organize your datasets effectively.
- 1. Open your Dataset in WPS: Launch WPS Spreadsheet and open your .xlsx file containing the parent and child records.
- 2. Apply Array Formulas: Select your target cell and input your combination of array functions (like UNIQUE, FILTER, and TEXTJOIN) to group and concatenate the data.
- 3. Format the Output: Use the Home tab to adjust text wrapping and cell dimensions so the concatenated child rows are easy to read and manage.

Frequently Asked Questions
Why is the TEXTJOIN function returning an error when combining child rows?
This usually happens if the range provided to TEXTJOIN contains errors or if the array generated by the FILTER function returns empty. Ensure your FILTER criteria correctly match the parent IDs and handle empty arrays using the if_empty argument in the FILTER function.
Can I concatenate child rows without using complex array functions?
Yes, you can use Power Query to group rows and extract values visually, or you can write a VBA macro to loop through the records and concatenate the child rows into the parent rows automatically.
Are dynamic array functions like VSTACK and HSTACK available in older Excel versions?
No, functions like VSTACK, HSTACK, and LET are only available in Microsoft 365 and Excel 2021 or newer. For older versions of Excel, consider using Power Query or VBA scripts as an alternative solution.
How do I separate the concatenated values with a line break?
In the TEXTJOIN function, use CHAR(10) as the delimiter argument (e.g., TEXTJOIN(CHAR(10), TRUE, range)). After applying the formula, ensure you have enabled 'Wrap Text' on the destination cells so the line breaks display correctly.




