[英]Partial match between two columns in excel, return value of one column
I have a task at hand where I need to create 301 redirect URLS but this falls into the Excel category as I am using that. 我手头有一个需要创建301重定向URL的任务,但这属于我正在使用的Excel类别。
I have a list of text strings in column A, in column BI have a list of text strings, that I need to partially match against the array of values in column A. I would like to do this in column C. 我在A列中有一个文本字符串列表,在BI列中有一个文本字符串列表,我需要与A列中的值数组部分匹配。我想在C列中做到这一点。
So, lookup if content of B is a partial match to Column A and post if there is a match, post the content of column B, in column C 因此,如果B的内容与A列部分匹配,则查找,如果有匹配,则发布,将B列的内容发布到C列
EDIT (TRIED TO ADD DATA): 编辑(尝试添加数据):
A
1: abadia-retuerta-seleccion-especial/
2: albiano-verdicchio-d-cast-di-jesi/
3: alois-lageder-gewurztraminer/
4: anselmi-capitel-foscarino-veneto-bianco/
B
1: agusti-torello-roca
2: abadia-retuerta
3: anselmi
4: alois-lageder
C (EXPECTED VALUES)
1: abadia-retuerta
2: <empty cell>
3: alois-lageder
4: anselmi
Use this array formula: 使用此数组公式:
=IFERROR(INDEX($B$1:INDEX(B:B,MATCH("ZZZ",B:B)),MATCH(1,IF(SEARCH($B$1:INDEX(B:B,MATCH("ZZZ",B:B)),A1),1,0),0)),"")
Put it in C1. 将其放在C1中。 Being an array formula it needs to be confirmed with Ctrl-Shift-Enter when exiting edit mode. 作为数组公式,退出编辑模式时需要使用Ctrl-Shift-Enter进行确认。 If done correctly Excel will put {}
around the formula. 如果正确完成,Excel会将{}
放在公式周围。 Then copy down. 然后抄下来。
The formula is made to be dynamic, in that no matter how large column B gets it will work. 该公式是动态的,因为无论B列多大,它都将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.