View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Curious[_2_] Curious[_2_] is offline
external usenet poster
 
Posts: 23
Default Group/Sort records in Excel

Hi,

I have the following in Excel. I'll need to add the "Shares" for each
"Security" by "Side" for each "Class".

Class_AccountName,Security,Side,Shares
------------------------------------
SmallCap_Account1,AA,Buy,1000
SmallCap_Account1,BB,Buy,1000
SmallCap_Account1,CC,Buy,1000
SmallCap_Account1,DD,Buy,1000
SmallCap_Account1,EE,Buy,1000
SmallCap_Account1,AA,Sell,1000
SmallCap_Account1,CC,Sell,1000
SmallCap_Account1,GG,Sell,1000
------------------------------------
SmallCap_Account2,AA,Buy,1000
SmallCap_Account2,CC,Buy,1000
SmallCap_Account2,DD,Buy,1000
SmallCap_Account2,AA,Sell,1000
SmallCap_Account2,BB,Sell,1000
------------------------------------
SmallCap_Account3,AA,Buy,1000
SmallCap_Account3,BB,Buy,1000
SmallCap_Account3,DD,Buy,1000
SmallCap_Account3,EE,Buy,1000
SmallCap_Account3,BB,Sell,1000
SmallCap_Account3,CC,Sell,1000
SmallCap_Account3,EE,Sell,1000
------------------------------------
MidCap_Acct1,AAA,Buy,1000
MidCap_Acct1,BBB,Buy,1000
MidCap_Acct1,CCC,Buy,1000
MidCap_Acct1,EEE,Buy,1000
MidCap_Acct1,AAA,Sell,1000
MidCap_Acct1,DDD,Sell,1000
MidCap_Acct1,EEE,Sell,1000
MidCap_Acct1,HHH,Sell,1000
MidCap_Acct1,XXX,Sell,1000
MidCap_Acct1,YYY,Sell,1000
------------------------------------
MidCap_Acct2,AAA,Buy,1000
MidCap_Acct2,CCC,Buy,1000
MidCap_Acct2,EEE,Buy,1000
MidCap_Acct2,GGG,Buy,1000
MidCap_Acct2,AAA,Sell,1000
MidCap_Acct2,EEE,Sell,1000
MidCap_Acct2,OOO,Sell,1000
MidCap_Acct2,XXX,Sell,1000
MidCap_Acct2,YYY,Sell,1000
------------------------------------

The ideal result for the example looks like the follows:

SmallCap:

AA,Buy,3000 (all of the shares for AA on Buy side are added in
SmallCap)
BB,Buy,2000
CC,Buy,2000
DD,Buy,3000
EE,Buy,2000
AA,Sell,2000 (all of the shares for AA on Sell side are added in
SmallCap)
BB,Sell,2000
CC,Sell,2000
EE,Sell,1000
GG,Sell,1000

MidCap:

AAA,Buy,2000 (all of the shares for AAA on Buy side are added in
MidCap)
BBB,Buy,1000
CCC,Buy,2000
EEE,Buy,2000
GGG,Buy,1000
AAA,Sell,2000 (all of the shares for AAA on Sell side are added in
MidCap)
DDD,Sell,1000
EEE,Sell,2000
HHH,Sell,1000
OOO,Sell,1000
XXX,Sell,2000
YYY,Sell,2000

Anyone can advise me on how to get the ideal results in Excel using
Excel commands?