在excel中的两列之间进行部分匹配,返回一列 [英] Partial match between two columns in excel, return value of one column

查看:311
本文介绍了在excel中的两列之间进行部分匹配,返回一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务在手,我需要创建301重定向URLS,但这属于Excel类别,因为我正在使用。



我有一个列表列A中的文本字符串,在列BI中有一个文本字符串列表,我需要部分匹配列A中的值数组。我想在列C中执行此操作。



所以,查找B的内容是否与列A的部分匹配,如果有匹配则发布,如果在列C中发布列B的内容,请在



  A 
1:abadia-retuerta-seleccion-specialec /
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 (预期值)
1:abadia-retuerta
2:<空单元格>
3:alois-lageder
4:anselmi


解决方案

使用此数组公式:

  = 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 )),)

将其放在C1中。作为数组公式,当退出编辑模式时,需要使用Ctrl-Shift-Enter确认。如果完成,Excel将在公式周围放置 {} 。然后复制下来。



公式是动态的,无论B列有多大,它都可以工作。




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

解决方案

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.

这篇关于在excel中的两列之间进行部分匹配,返回一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆