Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default subtotal calculation

(ignore previous post, I hit send before I was done...)

I have a spreadsheet similar to this:

Year City State Amount
03 Albertville AL 300
04 Albertville AL 300
Variance 0

03 Alexander City AL 24
04 Alexander City AL 60
Variance 36

03 Andalusia AL 180
04 Andalusia AL 240
Variance 60

I am programatically inserting the Variance row and
calculating the difference between the two years. This
works well.

Now, I want to provide a grand total of all the
variances. I can do this in code as well, but I really
want to use the subtotal function so that if a user filters
on a particular state/city, etc. the subtotal will only
represent the visible rows.
I tried building a subtotal calculation programatically in
code, but ran into a limit of how many cells could be
included in the formula.

Any other ideas on how to do this so that the users can
filter the data and have the totals re-calculated?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default subtotal calculation

Why not use the built in Subtotal function?

Also, you said you are adding variances? I am not sure that is meaningful.

--
Regards,
Tom Ogilvy

"Erin" wrote in message
...
(ignore previous post, I hit send before I was done...)

I have a spreadsheet similar to this:

Year City State Amount
03 Albertville AL 300
04 Albertville AL 300
Variance 0

03 Alexander City AL 24
04 Alexander City AL 60
Variance 36

03 Andalusia AL 180
04 Andalusia AL 240
Variance 60

I am programatically inserting the Variance row and
calculating the difference between the two years. This
works well.

Now, I want to provide a grand total of all the
variances. I can do this in code as well, but I really
want to use the subtotal function so that if a user filters
on a particular state/city, etc. the subtotal will only
represent the visible rows.
I tried building a subtotal calculation programatically in
code, but ran into a limit of how many cells could be
included in the formula.

Any other ideas on how to do this so that the users can
filter the data and have the totals re-calculated?




  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default subtotal calculation

I couldn't get the built-in subtotal function to calculate
DIFFERENCES between two numbers (only sums). I need it to
show the difference in customers ordered amount across the
2 years.

Anyway... I've figured it out. I'm still calculating
the variance rows myself, but then I'm also copying those
off to some hidden columns to the right on the
spreadsheet. My sub-totals at the bottom are then based
on those hidden columns. So, when a user filters, it then
re-calculates just perfectly!

Thanks for the help anyway.

-----Original Message-----
Why not use the built in Subtotal function?

Also, you said you are adding variances? I am not sure

that is meaningful.

--
Regards,
Tom Ogilvy

"Erin" wrote in

message
...
(ignore previous post, I hit send before I was done...)

I have a spreadsheet similar to this:

Year City State Amount
03 Albertville AL 300
04 Albertville AL 300
Variance 0

03 Alexander City AL 24
04 Alexander City AL 60
Variance 36

03 Andalusia AL 180
04 Andalusia AL 240
Variance 60

I am programatically inserting the Variance row and
calculating the difference between the two years. This
works well.

Now, I want to provide a grand total of all the
variances. I can do this in code as well, but I really
want to use the subtotal function so that if a user

filters
on a particular state/city, etc. the subtotal will only
represent the visible rows.
I tried building a subtotal calculation programatically

in
code, but ran into a limit of how many cells could be
included in the formula.

Any other ideas on how to do this so that the users can
filter the data and have the totals re-calculated?




.

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
Subtotal To Include Item Description On Subtotal Line Tickfarmer Excel Discussion (Misc queries) 2 February 23rd 10 07:56 PM
Subtotal of Pivot "Max" calculation problem gchild73 Excel Discussion (Misc queries) 0 July 10th 09 09:47 PM
Using Subtotal field of a pivot table in a calculation Ailish Excel Discussion (Misc queries) 2 February 23rd 07 01:03 PM
% of subtotal custom calculation in a pivot table Diego Excel Discussion (Misc queries) 2 January 31st 07 05:50 PM
pasting to subtotal lines without replacing hidden -non-subtotal l harleydiva67 Excel Discussion (Misc queries) 1 October 12th 06 06:02 PM


All times are GMT +1. The time now is 09:17 AM.

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"