Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gunther
 
Posts: n/a
Default how to group records in a new worksheet

I have a big datasheet in Excel which includes customer/product/sales
columns. In a new sheet I would like to consolidate all sales per customer
and in another per product. Then I would like to show the top20 customers
resp. top20 products. What is the best way to do this in Excel?
Thanks for your help.
Gunther
  #2   Report Post  
Posted to microsoft.public.excel.misc
patrickcairns
 
Posts: n/a
Default how to group records in a new worksheet


Although you could do it with a SUMIF function however I do get mixed
results on occasion when using this. It seems when a list is unsorted
it misses records. I would make a sheet with the list of all the
customers in column A and add the following VBA:

I am making an assumption that the amount of sales is in column B of
the BigDatasheet.

Sub CustomerRun
Dim i as interger
Dim Cust as string

Cust = Sheets("Customer").Range("A" & i).Value
For i = 1 to 500 <======== or higher if there are more customers
If Cust = Sheets("BigDataSheet").Range("A" & i).Value Then
Sheets("BigDataSheet").Range("B" & i).Copy
Sheets("Customer").Range("B" & i).Selection.PasteSpecial
Paste:=xlPasteValues, Operation:=xlAdd
End If
Next i

and the same process could be used for products.

After you have these lists it is just a sorting or filter job to get
the Top 20


--
patrickcairns
------------------------------------------------------------------------
patrickcairns's Profile: http://www.excelforum.com/member.php...o&userid=31790
View this thread: http://www.excelforum.com/showthread...hreadid=515133

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
How do I reference data from one worksheet to another using combob caricc New Users to Excel 0 December 17th 05 09:58 PM
One worksheet to calulate different items simultaneously John Excel Worksheet Functions 4 November 28th 05 07:07 PM
Extracting data from one Worsheet to Another Worksheet with common link value Edwin Mashiringwani Excel Discussion (Misc queries) 1 November 25th 05 03:14 AM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Need help w/ Weight Formula Tom Excel Discussion (Misc queries) 3 March 4th 05 05:23 PM


All times are GMT +1. The time now is 03:47 PM.

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

About Us

"It's about Microsoft Excel"