简体   繁体   English

结合VLOOKUP或MATCH和COUNTIF

[英]Combining VLOOKUP or MATCH and COUNTIF

I've been trying (and failing) to work out if it's possible to use a formula to count the "Yes" answers depending on whether there is certain text in a row above....and this certain text is in a data validation list. 我一直在尝试(并且失败)是否可以使用公式来计算“是”答案,具体取决于上方是否有某些文本....并且该特定文本在数据验证中清单。

For example, I have the sheet1 below and then on sheet2 I have a validation list in cell k1 with "school 1", "school 2" etc. I'm trying to see if it's possible in cell H4 of sheet2 to count the number of "Yes" in row 3 of sheet1 only if the contents of K1 (either "School 1" or "School 2" depending on which I select from the list) appears in row 2 in the same column? 例如,我下面有工作表1,然后在工作表2上,在单元格k1中有一个验证列表,其中包含“学校1”,“学校2”等。我试图查看是否可以在工作表2的单元格H4中对数字进行计数仅当K1的内容(取决于我从列表中选择的“学校1”或“学校2”)出现在同一列的第2行中时,才在sheet1的第3行中显示“是”吗?

A................B...............C................D A ....... B ...... C ................ d

School1.....School2....School1.....School1 School1 ..... School2 .... School1 ..... School1

Yes............No............Yes.............Yes 是............否............是............是

I'm not that great with Excel so would really appreciate it if someone could let me know if this just isn't possible! 我对Excel不太满意,所以如果有人让我知道这是不可能的话,我将不胜感激!

Many thanks! 非常感谢!

请试试:

=COUNTIFS(Sheet1!A2:D2,$K$1,Sheet1!A3:D3,"Yes")

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

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