Avatar of Anne Smith
Anne Smith

asked on 

Unpivot nested excel tables

Hi,

I have an excel file with below pivot table:
                                          2016                     2015                   2014      
            longitude      latitude      jan      feb      march      jan      feb      march      jan      feb      march
city1      12.34      20.1      2      3      4      56      14      22      33      11      10    30    21    11
city2      13.98      40.2      4      5      6      9      12      11      10      12      18    17    18    10
.
.
.

 and would like to flatten to:

      longitude      latitude      year        month      value
city1      12.34      20.1            2016              jan                2
city2      13.98      40.2           2016              jan               4
city1      12.34      20.1           2016             feb              3
city2      13.98      40.2           2016            feb              5
city1      12.34      20.1          2016            march      4
city2      13.98      40.2          2016            march      6
city1      12.34      20.1     2015            jan            56
city2      13.98      40.2           2015            jan            9

and so on.

Can anyone help.

Thanks
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Professor J

8/22/2022 - Mon