Home

How to combine rows based on duplicate numbers and combine text

Sam-L
New Contributor
I'm working with notification records and have thousands of cases with case number in one collumn multiple notification notices in another. Is there a way to merge rows with the same case number and preserve the text? Formatting doesn't particularly matter for how the text is merged as long as it's still there and reduces it to one row per case number. Thanks!
2 Replies
Like
1 | this
1 | that
2 | and
3 | the
3 | other
I want to merge based on collumn A and combine collumn B so it's
1 | this that
2 | and
3 | the other

@Sam-L Consider the following screenshot:

2019-04-04_12-45-55.jpg

 

Create a list of unique numbers. This can be done in various ways, for example with a pivot table. If you want an approach for that aspect, please pipe up.

 

Then you can use a TextJoin function, which is a new function in Excel 2019 and Excel 365. It is not available in earlier versions.

 

=TEXTJOIN(" ",TRUE,IF($A$1:$A$5=D1,$B$1:$B$5,""))

 

This is an array formula and must be confirmed with Ctrl + Shift + Enter (unless your Excel version already has the new dynamic array functions enabled).

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies