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
Bob Phillips - 14 Sep 2005 11:33 GMT
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

Signature
HTH
Bob Phillips
> Hi All,
>
[quoted text clipped - 37 lines]
>
> Neil
Neil - 14 Sep 2005 12:29 GMT
Excellent Bob,
Another good example of using a helper cell (column)
Thanks,
Neil
> You need to create a column that calculates the total for each company,
> and
[quoted text clipped - 49 lines]
>>
>> Neil