I believe that the following formula will do what you want:Formula:![]()
=INDEX($B$1:$I$1,AGGREGATE(14,6,(COLUMN($B$1:$I$1)-COLUMN($A$1))/($B$3:$I$3<=O7),1))
Note that the formula is only applied through row 20.
When you get ready to apply to row 26 > select cell B20 > press Ctrl + c > select cell B26 > press Ctrl + v > drag the fill handle over to cell AF26
Note that you'll need to modify the formula to include one more column than the columns containing countries in row 1 and you'll need to put a value in row 3 of the last column.
Note that you can hide the zeros (see H20:AF20) using conditional formatting.
Let us know if you have any questions.
Bookmarks