Icebreaker
Icebreaker

Reputation: 287

Sort this data in excel kinda like a pivot

All,

I have this data I pulled from a database that I need to readjust. Here it is:

ID | Type     | total
 1    Purchase   12
 1    Return     2
 1    Exchange   5
 3    Purchase   34
 3    Return     4
 3    Exchange   2

The desired result is:

ID | Purchase | Return | Exchange
 1      12         2         5
 3      34         4         2

and so on with a lot more data. Can this be done?

Upvotes: 0

Views: 32

Answers (1)

Clarinetist
Clarinetist

Reputation: 1187

In Excel, format the data like so:

enter image description here

Choose a cell in these data, go to Insert -> PivotTable, insert it where you would like, and use the following settings:

enter image description here

This gives

enter image description here

Under "Design" in the Ribbon (make sure that your PivotTable is selected), go to Grand Totals -> Off for Rows and Columns. This gives

enter image description here

Click the "Exchange" cell and go toward the top of it, right below the "Column Labels" cell - you will see that the arrowhead will change and you can drag the column:

enter image description here

Upvotes: 3

Related Questions