Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Duplicate Entry Sums

Status
Not open for further replies.

mcongdon

Programmer
Mar 14, 2008
98
US
Hey Everyone,
I have a spreadsheet that has been generated by a different program with about 27000 rows. It has 6 columns:
EXDATE,ACCT#,SYMBOL,SHARES,PRICE,and CLIENTCHARGE. I have sorted it by SYMBOL(ascending), EXDATE(ascending), then ACCT#(ascending). What I want to do is look for entries that are kind of duplicates(what we call multiple executions). I am looking for a way to search for entries that have the same EXDATE,ACCT#, and SYMBOL. Then, I would like to take the duplicates and sum the SHARES and the CLIENTCHARGE and create a new row, then delete all the duplicates it was created from. Here is an example:


EXDATE ACCT# SYMBOL SHARES PRICE CLIENT
4/28/08 123456 30274Y473 1963 9.83 2.50
4/28/08 111111 30274Y473 2246 9.86 32.50
4/28/08 111111 30274Y473 2000 9.86 12.41
4/29/08 111111 30274Y473 4000 9.86 26.35

The two trades in the middle are what I am looking for- they have the same EXDATE and ACCT# and SYMBOL. Therefore, what I would like to have as output would be:

EXDATE ACCT# SYMBOL SHARES PRICE CLIENT
4/28/08 123456 30274Y473 1963 9.83 2.50
4/29/08 111111 30274Y473 4000 9.86 26.35
4/28/08 111111 30274Y473 4246 9.86 44.91

I don't know if this is possible, but it would certainly make my life easier. Right now I have to go through all 27000 entries line by line and combine them myself.

I'm sorry for posting in multiple forums- I've read the FAQs on how to get great answers and repsonses; I realized that the VBA one might be more appropriate after I posted in the Office one. I'm pretty sure that VBA code would be the best way to do this.

Thanks!
 




Please refer to the post in Forum68. VBA is not a primary solution.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top