computing
  • 0

Macro to convert rows to columns

  • 0

I am trying to reformat my data from rows to columns.

Here is a sample of my data:
1976 29 571 1
1976 148 187 1
1976 156 3 1
1976 307 205 1

These are 4 separate columns. There are multiple entires for each year, from 1976 to 2006. However, the number of entries per year varies. I want my output to have one column per year, and then the rows to look something like:

29, 571
148, 187
156, 3
307, 205

Then within the table, I want the last number (in column 4). In this example, for each entry it would be 1.

Share