简体   繁体   English

Excel公式计算单元格中的特定特定单词

[英]Excel Formula to count specific specific words in cells

I have an issue if somebody spare his time to have a look at the problem so it will be nice.我有一个问题,如果有人抽出时间来看看这个问题,那会很好。 Thanks in advance.提前致谢。

I have different text in cells like yes, no, maybe.我在单元格中有不同的文本,例如是,否,也许。 I need to find the total number of cells that contain these text in a specific cell under average box.我需要在平均框下的特定单元格中找到包含这些文本的单元格总数。 I used the formula我用了公式

=COUNTIF(F3:K3,"*yes* ,*no* ,*maybe*") but the value what I got is like 1/0/1900 under average cell block

在此处输入图片说明 If you please have a look at the diagram so you will get my questions easily.如果你看一下图表,那么你会很容易地得到我的问题。 I need a general formula because I don't know the extension of range.我需要一个通用公式,因为我不知道范围的扩展。

  1. It seems you have date formatting enabled for your output cell at E3.您似乎在 E3 上为输出单元启用了日期格式。 Change it back to general or number to actually get a number instead of a number turned date将其改回一般数字以实际获取数字而不是数字转换日期

  2. You will need to count for each word and then combine the results.您需要对每个单词进行计数,然后合并结果。

    =COUNTIF(F3:K3, "yes") + COUNTIF(F3:K3, "no") + COUNTIF(F3:K3, "maybe") =COUNTIF(F3:K3, "是") + COUNTIF(F3:K3, "否") + COUNTIF(F3:K3, "可能")

  3. Optional: Make sure to always count between F and K independent of our current row number:可选:确保始终在 F 和 K 之间进行计数,而与我们当前的行号无关:

    =COUNTIF($F3:$K3, "yes") + COUNTIF($F3:$K3, "no") + COUNTIF($F3:$K3, "maybe") =COUNTIF($F3:$K3, "yes") + COUNTIF($F3:$K3, "no") + COUNTIF($F3:$K3, "maybe")

  4. For your consideration: Depending on your underlying problem, instead of counting strings you might consider to use numbers and do a simple sum().供您考虑:根据您的潜在问题,您可能会考虑使用数字并执行简单的 sum(),而不是计算字符串。 Yes = 1, No = 0, Maybe = .5是 = 1,否 = 0,也许 = .5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM