I took the liberty of standardizing some of the column headers. 1999 and 2009 were missing the M columns. It looked like typos. I changed them.
I inserted a row in DataAlex for a helper row. The helper row in of DataAlex has this formula in B1. Filled across it defines the common years.
This helper cell formula is in B1 of the Summary sheet. It defines the last row of the helper columns. It must be array entered (Ctrl + Shift + Enter).
Formula:
=COUNTA(DataAlex!$A$3:$A$23)*SUM(IF(FREQUENCY(DataAlex!$B$1:$IN$1,DataAlex!$B$1:$IN$1),1))
This is the helper column for the countries. Enter in B3 and fill down until you get blanks. it is non array.
Formula:
=IF((ROW()-ROW($3:$3)+1)>$B$1,"",INDEX(DataAlex!$A$3:$A$23,CEILING((ROW()-ROW($3:$3)+1)/19,1)))
This is the helper formula for years. It is non array. Enter in C3. Fill down until you get blanks.
Formula:
=IF(B3="","",INDEX(DataAlex!$B$1:$IN$1,,MOD(ROW()-ROW($3:$3),19)*13+1))
Array enter this in D3. I returns the data from DataAlex. Fill across and down until you get blanks.
Formula:
=IF(B3="","",IF((COLUMN()-COLUMN($D:$D)+1)>13,"",INDEX(INDEX(DataAlex!$B$3:$IN$23,MATCH(1,1/($B3=DataAlex!$A$3:$A$23),0),),SMALL(IF($C3=DataAlex!$B$1:$IN$1,MATCH(DataAlex!$B$2:$IN$2,DataAlex!$B$2:$IN$2,0)),COLUMN()-COLUMN($D:$D)+1))))
Bookmarks