0

In the following table, I'd like to concatenate the numbers of column B, according to string in column A:

My table

For example, all the numbers adjacent to XX would be copied to another cell in this format: 12, 12, 21, 23, 31, 32.

I can manually concatenate the whole of column B using:

=ArrayFormula(concatenate(B2:D&", "))

But I need to split those values according to column A.

I can manipulate this data in Google Sheets, Excel or Numbers.

4

2 回答 2

0

尝试这个:

 =ARRAYFORMULA({UNIQUE(A1:A5), TRIM(TRANSPOSE(QUERY(IF(transpose(UNIQUE(A1:A5))=A1:A5,B1:B5&",",""),,500000)))})

我希望你的行不超过 500000 并且你没有空白。

于 2017-09-19T16:16:13.997 回答
0

在 Excel 中:

=TEXTJOIN(", ",TRUE,IF(A1:A9 = "XX",B1:B9,""))

作为使用 Ctrl-Shift-Enter 而不是 Enter 的数组公式。

在此处输入图像描述

在 Google 表格中:

=JOIN(", ",FILTER(B1:B9,A1:A9="XX"))

在此处输入图像描述

于 2017-09-19T14:53:59.447 回答