I was given a spreadsheet that I need to reformat. I'm hoping there's a formula (INDEX + MATCH? HLOOKUP? XLOOKUP?) to make this simpler, but I can't figure out what it would be.
The source document has most of the variables in rows 1 and 2, with one variable in column A. I need to reformat it so that row 1 also becomes a column. Here's some screenshot examples with made-up information:
Source Document looks like this (with actual data in all the cells, I left them blank in my example)
I need the countries to be in a column and the years as only three columns, like this

Is there a way to do this? Transposing the data doesn't give me the results I want, so I think it needs to be a combination of some form of INDEX and MATCH with multiple variables. Any ideas are greatly appreciated!