In truth I think you should go for whatever route makes sense and you prefer
FWIW - I appreciate my approach might not be the easiest to implement given ranges etc so attached is my version.
I have added the vertical section also - though like the horizontal results I have 1 discrepancy which is that in Col M the result should be 8 rather than 9 1's (expected results implied 9)
As per the sample file the first 10 frequencies are returned - should you have more then they are not reported (this is per the setup of your file).
Bookmarks