Search code examples
excelexcel-formulavlookupcountifsumifs

VLOOKUP to count the amount of occurences


Good day,

I'm trying to set up a formula that would return me the amount of a certain result depending on the occurrence. As shown below, the occurrences are repeating itself, going from 1, 2, 3, 4 to 5 and then again from 1 onwards, whereas the result can be either A, B, C, D or E.

Excel screenshot

In this case, I want to check how often "B" appears in 1, how often in 2, how often in 3 etc.

The VLOOKUP() isn't returning me what I want and I could wrap things up with SUMIF() and MATCH() either. Any suggestions will be greatly appreciated.


Solution

  • You can use SUMPRODUCT:

    =SUMPRODUCT((B:B=$F$1)*(A:A=E2))
    

    enter image description here