Excel -如果第一行的第一个单元格等于一个值/字符串,然后如果行中的单元格等于一个值/字符串,则计数

时间:2022-12-31 22:18:23

I'm stumped with an Excel issue. I have tried variations of COUNTIFs and INDEX MATCH and can't get it to work.

我被一个Excel问题难住了。我尝试过各种数法和指数匹配法,但没有成功。

I have a spreadsheet with labels for each row vertically in the first column. what I want to do is, if the first cell of a row equals a specific value/string, then I want to count all occurrences of a different value/string in that row.

在第一列中,我有一个包含每一行垂直标签的电子表格。我要做的是,如果一行的第一个单元格等于一个特定的值/字符串,那么我要计算该行中出现的所有不同值/字符串。

I can't for the life of me figure it out.

我怎么也搞不清楚。

Edit:

编辑:

If I have a table like so

如果我有一张这样的桌子。

|-----------------|------------------|------------------|------------------|
|       Blue      |        Dave      |        Dave      |                  |
|-----------------|------------------|------------------|------------------|
|        Red      |                  |        Dave      |                  |
|-----------------|------------------|------------------|------------------|
|      Yellow     |        Dave      |        Dave      |       Andy       |
|-----------------|------------------|------------------|------------------|
|       Green     |                  |                  |       Andy       | 
|-----------------|------------------|------------------|------------------|

My question is, how can I can count all occurrences of "Dave" in the row where the first column equals "Yellow"?

我的问题是,如何计算第一个列等于“黄色”的行中出现的“Dave”?

1 个解决方案

#1


1  

If your other sheet (say Sheet2) has "Yellow" in A1, try:-

如果你的另一页(如Sheet2)在A1中有“黄色”,试试:-

=COUNTIF(INDEX(Sheet1!$B$1:$D$4,MATCH(A1,Sheet1!$A$1:$A$4,0),0),"Dave")

in Sheet2!B1

在Sheet2 ! B1

Excel -如果第一行的第一个单元格等于一个值/字符串,然后如果行中的单元格等于一个值/字符串,则计数

#1


1  

If your other sheet (say Sheet2) has "Yellow" in A1, try:-

如果你的另一页(如Sheet2)在A1中有“黄色”,试试:-

=COUNTIF(INDEX(Sheet1!$B$1:$D$4,MATCH(A1,Sheet1!$A$1:$A$4,0),0),"Dave")

in Sheet2!B1

在Sheet2 ! B1

Excel -如果第一行的第一个单元格等于一个值/字符串,然后如果行中的单元格等于一个值/字符串,则计数