Partial match between two columns in excel, return

2019-09-22 01:23发布

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.

I have a list of text strings in column A, in column B I 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.

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

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

标签: excel
1条回答
时光不老,我们不散
2楼-- · 2019-09-22 02:03

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. Being an array formula it needs to be confirmed with Ctrl-Shift-Enter when exiting edit mode. If done correctly Excel will put {} around the formula. Then copy down.

The formula is made to be dynamic, in that no matter how large column B gets it will work.

enter image description here

查看更多
登录 后发表回答