【问题标题】:Is there any Excel Formula for comparing 2 columns for containing data and counting their occurrence?是否有任何 Excel 公式用于比较 2 列以包含数据并计算它们的出现?
【发布时间】:2020-06-03 13:36:49
【问题描述】:

大家好
我在比较 Excel / G-Sheets 中的列中的数据时遇到了一些问题。
我尝试使用标准公式“=countif (A:A, B2)”比较 2 列与 公司名称,其中列 “A” 包含我要查找的公司名称(可接受) 和列 “B” 包含应与列 中的公司名称匹配的公司名称A”
例如,在“A”列中有一个单元格,其名称为公司“Apple”,如果在 "B" 列中没有带有 "Apple" 的单元格,则应返回 "0",但如果打开相反,它应该返回“1”、“2”等。 但问题是,如果一个带有“Apple Inc.”的单元格出现在 “B” 列中,它将返回 “0”,尽管这是同一家公司。因此,我试图找到一个公式,我可以在其中计算不完全匹配的单元格,但如果它甚至包含部分值。
例如,如果在 A 列中我们有一个值为 "Apple" 的单元格,如果在 B 列中我们有 "Apple Inc.", "GTX Apple" “The Apple” 值公式必须返回 “3”
我发现一些在 countif 公式中使用“*”符号,但它不能按我的意愿工作。有人可以帮我解决这个问题吗?

【问题讨论】:

  • 一些regular expresions 可以提供帮助,或者您可以使用VLOOKUP。它的定义是:=VLOOKUP(What you want to look up, where you want to look for it, the column number in the range containing the value to return, return an Approximate or Exact match – indicated as 1/TRUE, or 0/FALSE).

标签: excel excel-formula google-sheets-formula


【解决方案1】:

考虑:

=COUNTIF(B:B,"*" & A2 & "*")

【讨论】:

猜你喜欢
  • 2020-10-27
  • 2020-11-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-13
  • 2018-12-29
  • 2013-08-29
  • 1970-01-01
相关资源
最近更新 更多