healthbeats
healthbeats

Reputation: 7

Google Spreadsheet: Concatenate values if UNIQUE ID is equal

I am using g-sheet and trying to combine the company name in the case of the unique ID in the interval is equal

UNIQUE ID: 1 1 1 2 2 3
COMPANY NAME: A B C Z E K

Expected output:

1: A, B, C
2: Z, E
3, K

Upvotes: 0

Views: 395

Answers (1)

player0
player0

Reputation: 1

try:

=ARRAYFORMULA(FLATTEN(REGEXREPLACE(TRIM(QUERY(QUERY(
 {A2:A&":", B2:B&","}, 
 "select max(Col2) 
  where not Col1 starts with ':' 
  group by Col2 
  pivot Col1"),,9^9)), ",$", )))

enter image description here

Upvotes: 2

Related Questions