Based on how your data is set up in your example, it doesn't need to look at month or year number.
The INDEX portion of the function moves over one column for every column that the formula is dragged over. There is no need to complicate it.
If this formula isn't working as you expect on your actual spreadsheet, perhaps you should create a small representative sample of your data along with the desired result/s of the formula/s.
Bookmarks