Numbers 2: Create a new header cell, listing once the contents of a column

Not sure how to search for this question, and moreover I rather think that what I want might not be possible, but just in case I am asking it here.

I am looking for a way to create a new table where its headers will get their contents from the content of a column of another table, without duplicates though.

Example, the content of my column in Table A is listing countries codes.
FRA, GER, ITA, ITA, USA, FRA, UK, CA, FRA, FRA, USA, FRA, GER, FRA, USA, BRA, ITA, USA, UK etc.

What I want is a way to fetch a country code, if it is appearing just once, and create a second table (Table B), with headers the countries code.

So based on the above data, I should come with a table with 7 columns and headers:
FRA | GER | ITA | USA | UK | BRA | CA

Would something like this be ever possible with Numbers ?


Here is the solution that worked for me. The original solution was provided in a question I posted in Apple Support Communities.

I am posting it here, as an answer to anyone the might arrive here looking for the same solution.

The 2 Cell Functions:

=IF(COUNTIF(A$1:A2, A)=1, MAX(B$1:B1)+1, "") 

=LOOKUP(COLUMN(),  First::$B, First::$A)

Image

Original Answer: https://discussions.apple.com/thread/5960924