Sorting and grouping list totals

C

Curious

Morning,

I am looking for help with a macro that will enable me to process UK
intrastat information. Effectively the information will look like this

Column 1 Column 2 Column 3
1,000 101 NL
2,435 121 NL
2,565 121 DE
2,000 131 GB
2,500 101 NL

And I would like to be able to easily sort the output into the
following

Code Value Country
101 3,500 NL
121 2,435 NL
121 2,565 DE
131 2,500 GB

So in other words, each code is grouped together and totalled but
sorted and seperated by country code (column 3) - in the given
example, code 101 has two entries in the table, both from NL and
therefore are grouped as one but the 121 code has two entries but has
different country codes and therefore is seperated.

I hope that makes sense :)

Thanks to all in advance
 
C

Curious

Jim Thomlinson said:
This can be easily accomplished with a pivot table. Place the cursor anywhere
in the middle of the data you want to consolidate. Choose Data ->Pivot Table.
Choose Finish (9 times out of 10 it will make all of the right assumptions
for you.) Drag the "Code" to the right Column. Drag the Value to the Middle.
The country can be plced in a few different spots depending exactly what you
want. Experiment a little.... Pivot tables are kinda fun and really powerful.

Jim,

That works a treat - many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top