从关键字列表搜索关键字的公式 [英] Formula to search for a keyword from a keywords list

查看:726
本文介绍了从关键字列表搜索关键字的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本列表( Info 列)和类别列表(类别列)。 p>

我需要在info(信息类别)旁边添加一个列,我可以通过查找提及哪个类别对我的文本进行分类在我的文字内在SQL中,我这样做:

 选择信息,类别为[信息类别] 
FROM Info_List i LEFT JOIN Category_List c
ON i.Info like'%'+ c.Category +'%'


解决方案

要在Info列中的一些较长的文本中找到第一个匹配的类别,请在B2中使用此标准公式。

  = IFERROR(INDEX($ F:$ F,AGGREGATE(15,6,ROW($ F $ 2:INDEX($ F:$ F,MATCH(zzz,$ F:$ F) )/ ISNUMBER(MATCH(*& $ F $ 2:INDEX($ F:$ F,MATCH(zzz,$ F:$ F))&*,$ A2,0) COLUMN(A:A))),)

根据需要填写,如果您在信息中有多个匹配的类别。





订购您的关键字以降序如果您只是寻找第一个类别,您将发现CAT01将在CAT015之前找到。降序可以照顾这个。在空格中包含类别单词和信息短语也将减少误报,但标点符号干扰。注意第11行中的假阳性,其中 erat 在plac erat 中找到。


I have a list of texts (Info column) and list of categories (Category column).

I need an additional column next to info (Info Category) where I could categorize my texts by finding which category is mentioned inside my text. In SQL I did it like this:

SELECT info, Category as [Info Category]
FROM Info_List i LEFT JOIN Category_List c 
    ON i.Info like '%' + c.Category + '%' 

解决方案

To find the first matching category within some longer text in the Info column, use this standard formula in B2.

=IFERROR(INDEX($F:$F, AGGREGATE(15, 6, ROW($F$2:INDEX($F:$F, MATCH("zzz",$F:$F )))/ISNUMBER(MATCH("*"&$F$2:INDEX($F:$F, MATCH("zzz",$F:$F ))&"*", $A2, 0)), COLUMN(A:A))), "")

Fill down as necessary then fill right if you have multiple matching categories within the info.

    

Order your keywords in a descending manner. If you are only looking for the first category, you will find that CAT01 will be found before CAT015. A descending order can take care of this. Wrapping both the category words and the Info phrase in spaces will also reduce false positives but punctuation interferes. Note the false positive in row 11 where erat was found within placerat.

这篇关于从关键字列表搜索关键字的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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