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
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies