Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Unique category with sum

Hi,
I know how to use the advance filter to extract the unique category, but I
want to know how to calculate subtotal for each unique group and transfer all
these info to another worksheet, in code?

database:
apple,nz
apple,usa
orange,aus
apple,india
grape,aus

newsheet:
apple,3
orange,1
grape,1

Anyone?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Unique category with sum

I'd record a macro when I did Data|pivottable.

You can count each occurence of the group name.

Add a single row of headers
Select the whole range
Data|Pivottable
follow the wizard until you get to the step with a Layout button.
Click that button
Drag the GroupName button to the row field
drag the GroupName button to the data field
If you don't see "count of", double click on it and choose Count.um of

And finish up the wizard.

If you want to read more about pivottables...

Here are a few links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

choo wrote:

Hi,
I know how to use the advance filter to extract the unique category, but I
want to know how to calculate subtotal for each unique group and transfer all
these info to another worksheet, in code?

database:
apple,nz
apple,usa
orange,aus
apple,india
grape,aus

newsheet:
apple,3
orange,1
grape,1

Anyone?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Unique category with sum

Or you could use the data|filter|advanced filter to extract the unique entries.

Then fill up the adjacent cells with formulas like:

=countif(sheet1!a:a,a2)
(Headers still in row 1)

recording a macro will get you very close.

choo wrote:

Hi,
I know how to use the advance filter to extract the unique category, but I
want to know how to calculate subtotal for each unique group and transfer all
these info to another worksheet, in code?

database:
apple,nz
apple,usa
orange,aus
apple,india
grape,aus

newsheet:
apple,3
orange,1
grape,1

Anyone?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Unique category with sum

Thanks Dave.

"Dave Peterson" wrote:

Or you could use the data|filter|advanced filter to extract the unique entries.

Then fill up the adjacent cells with formulas like:

=countif(sheet1!a:a,a2)
(Headers still in row 1)

recording a macro will get you very close.

choo wrote:

Hi,
I know how to use the advance filter to extract the unique category, but I
want to know how to calculate subtotal for each unique group and transfer all
these info to another worksheet, in code?

database:
apple,nz
apple,usa
orange,aus
apple,india
grape,aus

newsheet:
apple,3
orange,1
grape,1

Anyone?


--

Dave Peterson

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
A SUB CATEGORY USING DATA VALIDATION? ALRDY USNG DV FOR CATEGORY sameer Excel Discussion (Misc queries) 2 January 11th 10 12:55 PM
Filer for unique records and return all column data for unique rec bseeley Excel Discussion (Misc queries) 1 September 12th 09 12:17 AM
Query on Category & Sub-category Santha Kumar Excel Discussion (Misc queries) 1 April 25th 07 12:30 PM
Add a category to the Insert-Function category list Tony Seiscons Excel Programming 1 September 22nd 04 02:41 PM
Formulas for...1. Counting unique cells 2. Display unique contents J Excel Programming 0 April 23rd 04 09:20 PM


All times are GMT +1. The time now is 12:30 AM.

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"