0

I want to return the occurance of specific text values from one column based on the values along the same row in other columns.

Example:

1 ¦ 2 ¦ 3 ¦
--+---+---+
W ¦ A ¦ T ¦
W ¦ A ¦ F ¦
L ¦ A ¦ T ¦
W ¦ A ¦ T ¦
W ¦ B ¦ T ¦
L ¦ B ¦ T ¦

In this example, I would like to return all occurances of T in Column 3 if the value of column 1 is W and the value in column 2 is A.

In other words, I'd expect the function to return 2.

In terms of code, I would do something like this:

for(x=0; x < rows; x++){
    if(table[x][1] == "W" && table[x][2] == "A" && table[x][3] == "T"){
       count++;
    }
}

1 Answer 1

1

You need to use COUNTIFS:
=COUNTIFS(A:A,"W",B:B,"A",C:C,"T")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .