=LET(
table, C3:O6,
header, DROP(TAKE(table, 1),, 1),
fields, PROPER(UNIQUE(TRIM(REPLACE(header, 1, 4, )), 1)),
labels, LAMBDA(n, TOCOL(CHOOSE(n, TAKE(DROP(table, 1),, 1), --UNIQUE(LEFT(header, 4), 1)))),
output, HSTACK(labels({1}), labels({2}), WRAPROWS(TOCOL(DROP(table, 1, 1)), COLUMNS(fields))),
group, SORT(VSTACK(output, EXPAND(UNIQUE(TAKE(output,, 2)),, COLUMNS(output), "")), {1,2}, {1,-1}),
items, TAKE(group,, 2),
noRept, HSTACK(IF(VSTACK({"",""}, DROP(items, -1))=items, "", items), DROP(group,, 2)),
VSTACK(HSTACK("Country", "Year", fields), noRept)
)