比较两列以包含数据并计算其出现次数的公式? [英] Formula for comparing 2 columns for containing data and counting their occurence?

查看:102
本文介绍了比较两列以包含数据并计算其出现次数的公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel中比较数据时遇到问题.我之前曾问过类似的问题(

I faced a problem with comparing data in excel. I asked a similar question earlier (Is there any Excel Formula for comparing 2 columns for containing data and counting their occurrence?), but my problem still not solved.

所以请帮助我,某人.我将展示我想要获得的东西的一个例子:

So please help me, someone. I will show an example of what do I want to get:

如您在这些屏幕截图中所见,公式返回了"1".仅当它是完全匹配时才需要值,但我需要一个近似匹配.因此,例如,如果我需要"Apple"我有"Apple Inc"公式必须返回"1"原因单元格包含"Apple".

As you can see by these screenshots formula returns me "1" value only if it is an exact match, but I need an approximate match. So for example, if I need "Apple" and I have "Apple Inc" formula must return "1" cause cell is containing "Apple".

我将为此gsheet附加一个链接,以使我的问题更清楚.

I will attach a link for this gsheet to make my question clearer.

https://docs.google.com/spreadsheets/d/1croUUM3XZTblqpqIva73qX54JeR8oC1cCsMOWyCW1us/edit#gid = 0

推荐答案

我喜欢Chronocidal的解决方案,但是这种方式对我说得更多:

I like Chronocidal's solution but this way speaks more to me:

=SUM(1*NOT(ISERROR(FIND('Named Focus List'!$A2:A4,Sheet1!A2))))

我认为这使我们正在努力实现的目标更加清晰. 找到"消息.如果A2在A2到A4的每个元素中都包含子字符串,则返回数字位置的向量,否则返回错误. 错误"的组合包括:和非"如果A2在A2至A4的每个元素中都包含子字符串,则返回一个取值为TRUE的向量.乘以1会将TRUE变成1,将FALSE变成零值.然后,将和"取整.函数然后生成所需的计数.

I think it makes it clearer what we are trying to accomplish. The "find" returns a vector of numerical locations if A2 contains substring in each of the elements of A2 to A4 and an error if it does not. The combination of "iserror" and "not" returns a vector taking a value TRUE if A2 contains substring in each of the elements of A2 to A4. Multiplying by 1 turns TRUE into 1 and FALSE into zero values. Then the "sum" function then generates the desired count.

您可以使用Chronocidal的巧妙代码来避免对列表的范围进行硬编码,但是我担心执行无空白单元格要求.

You can use Chronocidal's clever code to avoid hard coding the range of the list, but I'd be worried about enforcing the no blank cell requirement.

这篇关于比较两列以包含数据并计算其出现次数的公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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