What im trying to achieve is the following in excel:

[example](https://i.stack.imgur.com/TeOos.png)

So what i need to do is list the occurrence of cat and dog based on the index (a or b). I have a large amount of data that i need to do this on