I'm trying to program a function that will search a column for a specific data set and then compare it to data from another column. Then I want it to count the number of times that the data from one column is the same as the other. I tried:

=sum((countif (A2:a45, "Yes"), countif(b2:b45, "Yes")) I realized that it would just add all of the yeses. I do have the latest version of Excel and it seems to have more functions. Is there a comparison function?

English translation - Compare a2 to b2. If they are both yes, count 1. Then do this for each cells in column a and column b.