Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Adding sub-total

Hi, I got a column with items and their categories. I need to sum up those
belonging to the same category. I am thinking of looping the column and
comparing the 1st row with the 2nd row, if they are the same, I add them up.

But I don't how to continue from there. Please advise.

Elsie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Adding sub-total

Hi,

If your list is like this

state price
NY 2
NY 33
NY 4
NY 4
NY 5
NY 35
CT 25
CT 32
CT 234
CT 234



then select the whole table then use DAta subtotal to get something
like this
state price
NY 2
NY 33
NY 4
NY 4
NY 5
NY 35
NY Total 83
CT 25
CT 32
CT 234
CT 234
CT Total 525
Grand Total 608

hope it helps.


Elsie wrote:

Hi, I got a column with items and their categories. I need to sum up those
belonging to the same category. I am thinking of looping the column and
comparing the 1st row with the 2nd row, if they are the same, I add them up.

But I don't how to continue from there. Please advise.

Elsie


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Adding sub-total

Thanks for your suggestion cesar. But I need it to run automatically.
A sample of my data as follows:

Category Unit Price Prev Mth Qty Prev Mth Amt This Mth Qty
This Mth Amt YTD Qty YTD Amt
ACC 100 1 100
2 200 3 300
ACC 200 0 0
1 200 1 200

I need a macro to sum up the prev mth qty and amt columns and this mth qty
and amt columns and the ytd qty and amt columns.

Anyone got any ideas? I think the code needed will be quite complex.

Please help , I'm quite a newbie in VBA.

Thanks.

Elsie


"Cesar Zapata" wrote in message
...
Hi,

If your list is like this

state price
NY 2
NY 33
NY 4
NY 4
NY 5
NY 35
CT 25
CT 32
CT 234
CT 234



then select the whole table then use DAta subtotal to get something
like this
state price
NY 2
NY 33
NY 4
NY 4
NY 5
NY 35
NY Total 83
CT 25
CT 32
CT 234
CT 234
CT Total 525
Grand Total 608

hope it helps.


Elsie wrote:

Hi, I got a column with items and their categories. I need to sum up

those
belonging to the same category. I am thinking of looping the column and
comparing the 1st row with the 2nd row, if they are the same, I add them

up.

But I don't how to continue from there. Please advise.

Elsie




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 keep adding to existing total in same row marklessexcel New Users to Excel 3 October 17th 08 07:07 PM
Adding total from one worksheet to another rn2pacu Excel Worksheet Functions 2 May 9th 07 01:10 AM
KEEPING THE TOTAL IN C3 WHEN ADDING B3 bouncer8 Excel Discussion (Misc queries) 3 August 19th 06 01:21 AM
KEEPING THE TOTAL IN C3 WHEN ADDING B3 bouncer8 Excel Discussion (Misc queries) 1 August 18th 06 02:41 PM
Adding Data Using Multiple Worksheets to Total into a Grand Total Lillie Excel Worksheet Functions 1 April 19th 05 08:34 PM


All times are GMT +1. The time now is 03:21 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"