[英]Excel Formula - Criteria To Concatenate multiple cells by matching source cell
I am Looking to concatenates multiple cells into one by Index-matching the criteria我希望通过索引匹配标准将多个单元格连接成一个单元格
The below formula is not pulling in all the required UPCs against the specified criteria以下公式并未根据指定标准提取所有必需的 UPC
=INDEX($B:$B,MATCH($D:$D,$A:$A,0))
I would like the end result to look like COL E2 in the below image with semi-colons in between every value ;
我希望最终结果看起来像下图中的 COL E2,每个值之间都有分号
;
Any help here would be much appreciated.在这里的任何帮助将不胜感激。
If you have Office365 then use TEXTJOIN()
with FILTER()
function.如果你有Office365然后使用
TEXTJOIN()
和FILTER()
function。
=TEXTJOIN(";",TRUE,FILTER($B$2:$B$15,$A$2:$A$15=D2))
Edit: Assuming you don't have access to
O365
dynamic formulas.编辑:假设您无权访问
O365
动态公式。 Then try below array formula.然后尝试下面的数组公式。
=TEXTJOIN(";",TRUE,IF($A$2:$A$15=D2,$B$2:$B$15,""))
Press CTRL + SHIFT + ENTER to evaluate the formula as it is an array formula.按CTRL + SHIFT + ENTER计算公式,因为它是一个数组公式。
An alternative approach using the CONCAT
function:使用
CONCAT
function 的另一种方法:
=CONCAT(FILTER(B:B, A:A=D2)&";")
Explanation:解释:
FILTER
logic is just like Harun24HR suggested. FILTER
逻辑就像 Harun24HR 建议的那样。 Creating an array of all the values in B where the value in A is equal to D2.CONCAT
function combines all of the elements in the array into a single string.CONCAT
function 将数组中的所有元素组合成一个字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.