Say I have the following column headings filled with data on Sheet2:
| Station number | Year | Month| Rainfall (mm) |
XX1 1995 1 30
XX1 2005 4 50
XX1 2004 5 70
...
And the following columns on Sheet1:
|Year | Month of Max | mm | Month of Min | mm |
2004
2005
2006
...
I have the following code under the "Month of Max" column:
=INDEX(Sheet2!B2:B10000,MATCH(MAX(Sheet2!D2:D10000),Sheet2!D2:D10000,0))
However, I want to match the years too (i.e. the year in Sheet1!A2 should match the year in Sheet2!B2:B10000 for looking up the maximum rainfall). I can't figure out where to put this function and keep getting errors. Sorry if this is obvious or has been asked before, I'm just very stuck!