Hello,
I am trying to do a two-way lookup of a matrix table using index match given two things:
See below for a sample of the table:
Row 1 contains the years going back to 1998.
Beneath the year, are the values themselves.
And Column A contains the category (1-16) that I need to return.
As mentioned above, I am given Year and Value.
Need to return the category (Col A) that is closest based on the table.
Example:
This would work perfectly if I only had one year of data to lookup (i.e. 2023):
=index(Table!$A$2:$A$17,match(min(abs(Table!$C$2:$C$17-$C3)),abs(Table!$C$2:$C$17-$C3),0)))
Unfortunately my dataset spans all 25+ years.
Any thoughts on how to do this using index match?
Feel like I'm kind of on the right track with the above formula, but struggling right now to incorporate the two-way lookup.
I am trying to do a two-way lookup of a matrix table using index match given two things:
- Year
- Value
See below for a sample of the table:
Row 1 contains the years going back to 1998.
Beneath the year, are the values themselves.
And Column A contains the category (1-16) that I need to return.
2024 | 2023 | 2022 | 2000 | 1999 | 1998 | ||||
1 | 100 | 99 | 95 | 55 | 51 | 48 | |||
2 | 99 | 97 | 90 | 52 | 49 | 44 | |||
3 | 96 | 93 | 86 | 50 | 47 | 39 | |||
14 | 87 | 85 | 68 | 22 | 20 | 16 | |||
15 | 83 | 81 | 60 | 19 | 18 | 15 | |||
16 | 80 | 78 | 56 | 16 | 15 | 12 |
As mentioned above, I am given Year and Value.
Need to return the category (Col A) that is closest based on the table.
Example:
Year | Provided Value | Category |
2023 | 91 | Should return 3 here |
2022 | 87 | Should return 3 here |
1998 | 15 | Should return 14 here |
This would work perfectly if I only had one year of data to lookup (i.e. 2023):
=index(Table!$A$2:$A$17,match(min(abs(Table!$C$2:$C$17-$C3)),abs(Table!$C$2:$C$17-$C3),0)))
Unfortunately my dataset spans all 25+ years.
Any thoughts on how to do this using index match?
Feel like I'm kind of on the right track with the above formula, but struggling right now to incorporate the two-way lookup.