VLOOKUP value and return CONCATENATE text by date in several rows

nuficek

Board Regular
Joined
Jul 20, 2016
Messages
54
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a large table with date, ID and text (several columns). I would like to search value in ID column and return concatenate text. That's not so big deal which I can manage. But as there could be more same ID values for several dates. So would like to find this value and join text together in one row by date. So in the first row there will be the first string matching the date, the second row the second string matching the date ...etc. Is there any chance to do that in Excel?

example.xlsx
ABCDEFGHI
1DateIDDATA 1DATA 2SEARCH:ID05
21.9.2021ID01text1text2
32.9.2021ID01text3text4DateDATA
415.9.2021ID05text5text615.9.2021text5 - text6 - text7 -text8
515.9.2021ID05text7text817.9.2021text9 - text10
616.9.2021ID05text9text10
720.9.2021ID33text33text34
Sheet1
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You need to drag the formula in G4 down.
Hi, thanks a lot for your help and explanation. Just wanna ask one more thing. Is there a way to use the formula with non-adjacent columns? I import data from external source and I need to use just some of the columns. I now it's possible to use help table and copy the columns in the correct coherent order. But I'm just curios if it's possible or it's too complicated and it's better to use the help table.

example.xlsx
ABCDEFGHIJ
1DateIDDATA 1INFODATA 2SEARCH:ID05
21.9.2021ID01text1aaatext2
32.9.2021ID01text3bbbtext4DateDATA
415.9.2021ID05text5ccctext615.9.2021text5 - text6 - text7 -text8
515.9.2021ID05text7dddtext816.9.2021text9 - text10
616.9.2021ID05text9eeetext10
720.9.2021ID33text33ffftext34
Sheet1
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGH
1DateIDDATA 1INFODATA 2SEARCH:ID05
201/09/2021ID01text1aaatext2
302/09/2021ID01text3bbbtext4DateDATA
415/09/2021ID05text5ccctext615/09/2021text5 - text6 - text7 - text8
515/09/2021ID05text7dddtext816/09/2021text9 - text10
616/09/2021ID05text9eeetext10
720/09/2021ID33text33ffftext34
8
9
Lists
Cell Formulas
RangeFormula
G4:G5G4=UNIQUE(FILTER(A2:A10,B2:B10=H1))
H4:H5H4=TEXTJOIN(" - ",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G4)),LEFT($C$1:$E$1,4)="Data"))
Dynamic array formulas.
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGH
1DateIDDATA 1INFODATA 2SEARCH:ID05
201/09/2021ID01text1aaatext2
302/09/2021ID01text3bbbtext4DateDATA
415/09/2021ID05text5ccctext615/09/2021text5 - text6 - text7 - text8
515/09/2021ID05text7dddtext816/09/2021text9 - text10
616/09/2021ID05text9eeetext10
720/09/2021ID33text33ffftext34
8
9
Lists
Cell Formulas
RangeFormula
G4:G5G4=UNIQUE(FILTER(A2:A10,B2:B10=H1))
H4:H5H4=TEXTJOIN(" - ",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G4)),LEFT($C$1:$E$1,4)="Data"))
Dynamic array formulas.
That's great, it works. I understand the most of formula. But could you explain me closer the part LEFT($C$1:$E$1,4)="Data" how this works. I really don't want to just copy what you devise but I would like to learn from it.
 
Upvote 0
That's great, it works. I understand the most of formula. But could you explain me closer the part LEFT($C$1:$E$1,4)="Data" how this works. I really don't want to just copy what you devise but I would like to learn from it.
How about
+Fluff 1.xlsm
ABCDEFGH
1DateIDDATA 1INFODATA 2SEARCH:ID05
201/09/2021ID01text1aaatext2
302/09/2021ID01text3bbbtext4DateDATA
415/09/2021ID05text5ccctext615/09/2021text5 - text6 - text7 - text8
515/09/2021ID05text7dddtext816/09/2021text9 - text10
616/09/2021ID05text9eeetext10
720/09/2021ID33text33ffftext34
8
9
Lists
Cell Formulas
RangeFormula
G4:G5G4=UNIQUE(FILTER(A2:A10,B2:B10=H1))
H4:H5H4=TEXTJOIN(" - ",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G4)),LEFT($C$1:$E$1,4)="Data"))
Dynamic array formulas.
I got it. I went deep inside and I figured out. So no need for explanation. Thanks a lot!
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0
Hi,
I found a limitation of my table. Sometimes there are the same values in columns DATA1 and DATA2 for the same day. Is it possible to eliminate redundancy according the example?

example.xlsx
ABCDEFGHIJ
1DateIDDATA 1INFODATA 2SEARCH:ID05
21.9.2021ID01text1aaatext2
32.9.2021ID01text3bbbtext4DateDATA
415.9.2021ID05text5ccctext615.9.2021text5 - text6 - text7
515.9.2021ID05text6dddtext716.9.2021text7 - text8
616.9.2021ID05text7eeetext8
720.9.2021ID33text33ffftext34
Sheet1 (2)
Cell Formulas
RangeFormula
G4:G5G4=UNIQUE(FILTER(A2:A10,B2:B10=H1))
H5H5=TEXTJOIN(" - ",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G5)),LEFT($C$1:$E$1,4)="Data"))
Dynamic array formulas.
 
Upvote 0
How about
Excel Formula:
=TEXTJOIN(" - ",,UNIQUE(FILTERXML("<k><m>"&TEXTJOIN("</m><m>",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G4)),LEFT($C$1:$E$1,4)="Data"))&"</m></k>","//m")))
 
Upvote 0
Solution
How about
Excel Formula:
=TEXTJOIN(" - ",,UNIQUE(FILTERXML("<k><m>"&TEXTJOIN("</m><m>",,FILTER(FILTER($C$2:$E$10,($B$2:$B$10=$H$1)*($A$2:$A$10=G4)),LEFT($C$1:$E$1,4)="Data"))&"</m></k>","//m")))
Thanks a lot for quick reply. That's also totally new function for me so I have to look closer to it and study how it works otherwise it doesn't make sense for me ;)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top