[英]Lookup and concatenate unique multiple values into one cell
I have the following table我有下表
Type![]() |
Item![]() |
---|---|
Fruit![]() |
Banana![]() |
Veg![]() |
Carrot![]() |
Fruit![]() |
Mango![]() |
Fruit![]() |
Banana![]() |
Veg![]() |
Lettuce![]() |
Fruit![]() |
Banana![]() |
Fruit![]() |
Apples![]() |
Fruit![]() |
Mango![]() |
I want to look up the Type
, in this case Fruit
and return into a single cell, a list of unique Item
's.我想查找
Type
,在本例中为Fruit
并返回到单个单元格中,即唯一Item
的列表。 For example, looking on up Fruit
would return Banana; Mango; Apples
例如,查找
Fruit
将返回Banana; Mango; Apples
Banana; Mango; Apples
Banana; Mango; Apples
. Banana; Mango; Apples
。 As you can see, we did not add the duplicate Banana
's and Mango
's如您所见,我们没有添加重复的
Banana
和Mango
I have tried the following, where D2
cell contains the type Fruit
:我尝试了以下操作,其中
D2
单元格包含类型Fruit
:
=TEXTJOIN(" ", TRUE, IF(D2=A2:A9, B2:B9, ""))
I want to do this in pure excel, no VBA我想在纯 excel 中执行此操作,没有 VBA
Assuming you have Excel as part of the Office 365 package, you can achieve this using unique & filter (screenshot / this link refer):假设您将 Excel 作为 Office 365 包的一部分,您可以使用 unique & filter 实现这一点(屏幕截图/此链接参考):
=TextJoin(",",True,UNIQUE(FILTER(C5:C12,B5:B12=F4)))
(modify True/False if you want blanks to appear; customize delimiter as desired) (如果要出现空格,请修改 True/False;根据需要自定义分隔符)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.