Search code examples
exceltextexcel-formulacount

How can I count how many cells are the same in both rows?


I'm currently struggling with something that seems to me like it should be quite simple. I have the following two rows in a spreadsheet, say A and B from 1 to 5:

Strategic, Input, Restorative, Learner, Individualization

Connectedness, Strategic, Intellection, Learner, Achiever

How can I count how many words are the same in both rows? The answer in the above case should be 2.


Solution

  • This array formula should work:

    =SUM(IFERROR(MATCH(A:A;B:B;0)/MATCH(A:A;B:B;0);0))-1
    

    When introducing the formula don't press enter. You have to press Control+Shift+Enter.

    It should be shown like this, with curly brackets: enter image description here