I have source data (example in A3:G9 in the attached) which is a dump from a database and I cannot change how it outputs, it is outputed each month with the old month dropping off and a new month added each month (the dates and data rows are not static). I need to be able to lookup/reference this data to fill in another spreadsheet, but it is also in a pre-defined format (example in A15:D25) with other calculations among the database data. The database data sorts by Date as part of the output. The example is a very small snapshot - the real data is 3 years of monthly values for around 300 IDs, across 8 Value/ID columns.
I'm after a formula which I will be able to use regardless of if the ID is in column C, E or G and return the value in the corresponding Value column (which is the column BEFORE the ID) for the given date. I can make an INDEX and MATCH combination work for just one ID/Value set (i.e. M94 using date and columns B&C), but cannot make it work to look in columns E&D if the ID is not in column C (e.g. for M96) or G&F if not in C or E (e.g. M97). The cells in yellow are where I need results. My current INDEX/MATCH formula is in C17,19 & 20 - while I could use this (IDs in column C will always be in column C each time the database data is pulled), it will be tedious to match which formula goes in which row in the 2nd spreadsheet.
Thanks,
Trish
Bookmarks