Tricky - sort within a sort, assistance required please

N

Neil

Hi All,

I have a tricky excel macro opportunity.....

My sheet(s) consist of sales data for a number of companies, populating
columns A through to O.

Column A lists company names.
Column M lists Sales $ achieved.

Within column A, there may be a group of identical entries (company names)
that are differentiated somewhere else in the sheet.

What I would like to do is sort by group of companies first, so the group of
like named companies in column A with the greatest
aggregate total of sales in column M should be listed at the top of the
sorted list then each of the comanies within the group should then
be sorted by Sales $, column M.

ie. for columns A & M

CCC $34
CCC $26
CCC $21
CCC $19
PP $ 89
BB $75
BB$6

The CCC group of companies has a total Sales $ of 100, hence is listed
first.
The company PP has a total of $89 hence is listed second.
Company BB totals $81 so is listed third.

Make sense ???

I appreciate the groups responses,

Thanks,

Neil
 
B

Bob Phillips

You need to create a column that calculates the total for each company, and
use that in the sort.

Maybe in N1

=SUMIF(A:A,A1,M:M)

an d copy down
 

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