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

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

问题描述

我在 excel 中比较数据时遇到了问题.我之前问过一个类似的问题(

解决方案

我喜欢 Chronocidal 的解决方案,但这种方式对我来说更能说明问题:

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

我认为这让我们更清楚地了解我们要实现的目标.发现"如果 A2 在 A2 到 A4 的每个元素中都包含子字符串,则返回数字位置的向量,否则返回错误.iserror"的组合和不"如果 A2 在 A2 到 A4 的每个元素中包含子字符串,则返回一个值为 TRUE 的向量.乘以 1 将 TRUE 变为 1,将 FALSE 变为零值.然后总和"函数然后生成所需的计数.

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

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:

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".

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

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

解决方案

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

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

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.

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.

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

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