Excel中的关键字文本匹配,使用函数创build子类别

在Excel中,我们在邮件的主题行中设置关键字,并创build错误types的子类别。

现在关键字列表日益增多。 所以我试图创build一个公式来处理一个数组结构。

**Sub_Category** **Mathcing_Keywords** Switch/ Port utilization threshold of high utilization 90 exceeded Loan Related / HMDA Reports / Other Reports loan restore VDI Issues VDI Alerts For Zenoss Process not running **Subject_Line** **Created_Sub_Category_using function** Subject: Please install SQL Client VDI Assigned to me VDI Issues Subject: RE: Facing issue with VDI machine VDI Issues 

当前我们正在使用的公式创build子类别。

 =IFERROR(IF(SEARCH($B$2,D2),$A$2,1),IFERROR(IF(SEARCH($B$3,D2),$A$3,1),IFERROR(IF(SEARCH($B$4,D2),$A$4,1),IFERROR(IF(SEARCH($B$5,D2),$A$5,1),"NA")))) 

任何提示或帮助函数将被用来创build数组来完成工作。

假设您的关键字在不同的名为Keywords表中,如下所示:

在这里输入图像说明

使用以下公式从主题获取相应的关键字:

 =INDEX(Keywords!$A$2:$A$5,MAX(IF(ISERROR(FIND(Keywords!$B$2:$B$5,A2)),-1,1)*ROW(Keywords!$B$2:$B$5)-1)) 

这是一个数组公式,通过按Ctrl + Shift + Enter来提交

结果如下:

在这里输入图像说明

注意: FIND是区分大小写的,所以如果你想匹配是不区分大小写的,使用SEARCH函数。