Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dpb dpb is offline
external usenet poster
 
Posts: 1
Default Merge rows into one based on value

OK, I know there should be an easy way to do this, but...

I want/need to automate a process wherein a downloaded worksheet has
one or more instances where there are two or more rows of data for a
particular quantity. What I need is to total the values of certain
columns in those rows for the matching cells and replace the values in
(say) the last of the matching rows w/ the sum, then remove the extra
rows of partial data.

My attempts have failed to do this in anything at all approaching a
clean method. Can someone give an outline of a macro that would do
such an operation as a model? Thanks.

Example--

Symbol #Shares Cost Close Value
ABCD 324 31.21 34.55 11194.20 ...
ABCD 25 33.00 34.55 863.75 ...
BDDE 100 14.44 12.22 1222.00 ...
....

Wanted end result
Symbol #Shares Cost Close Value
ABCD 349 31.34 34.55 12057.95 ...
BDDE 100 14.44 12.22 1222.00 ...
....

where the cost is the (weighted) average cost and the value is the
total...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
return multiple rows of data based on criteria steve_sr2 Excel Worksheet Functions 8 May 20th 23 07:47 PM
sorting rows based upon formatting ahaigh Excel Discussion (Misc queries) 5 June 23rd 06 02:29 PM
Outlining - collapse rows based on repeated column value Beebe Excel Discussion (Misc queries) 4 June 15th 06 12:39 AM
Merge from Excel to Word - why are only even rows merged? djcox Excel Discussion (Misc queries) 1 June 10th 06 01:43 AM
Merge two rows into one, then merge into mailer? tavat Excel Worksheet Functions 0 May 24th 06 07:52 PM


All times are GMT +1. The time now is 08:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"