How to transform row information into columns in this case

  • I need to transform row information into columns:


    Transform


    COUNTRY

    POPULATION

    1

    US

    330

    2

    Canada

    38

    3

    Mexico

    130


    Into

    COUNTRY_1

    POPULATION_1

    COUNTRY_2

    POPULATION_2

    COUNTRY_3

    POPULATION_3

    US

    330

    Canada

    38

    Mexico

    130


    Or just into

    POPULATION_1

    POPULATION_2

    POPULATION_3

    330

    38

    130



    HELP_1_EXCEL.xlsx

  • Thanks Carim,

    I will review your response in detail.

    In reality this needs to work for a table which has 52,000 lines, many Countries, and many fields for each country, not just Population.

  • Re,


    The number of lines is irrelevant ... but the number of Columns is not ...


    Do you mind posting a sample with say 5-10 rows ...BUT with ALL the Columns ..

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Sure, I append a sample of the file. We need a single row per LOCAL (voting site) which contains all the political PARTIES votes (7 fields of VOTES, including nulls, blanks, impeached, etc)
    There are 8 political PARTIES.
    The result should be 3 rows, one per each LOCAL (voting site).


    SAMPLE.xlsx

  • Thanks for the Sample file


    However, seems to me your latest request has nothing to do with the initial one ...


    In addition, since my crystal ball is broken ... I cannot double-guess the RESULT you are aiming for ...


    Which Data is relevant to you ? ..... In which Format ?

    Files

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Here is a sample of the INPUT xls and the required OUTPUT xls.Both formats are .XLSX
    The relevant data is VOTES per PARTY for each SITE (1 row per SITE), that is, 3 rows in the output.
    The input has one row per PARTY per SITE, a total of 3x8=24 rows in the input.


    Thanks for your assistance.


    SAMPLE_2.xlsx