View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Custom Calculations in Subtotal

There is no way to modify what is offered.

You would probably need to write a macro that executes the subtotal command
and then adds the additional formulas, or just do the whole thing in a
macro.

Since you are showing only one line of detail for Name, it is hard to tell
what the definition of +/- Sales would be on the subtotal line.

I assume it would be a percentage for the subtotals, but it could be a sum
of the percentages although that makes less sense.

Regards,
Tom Ogilvy


"CST" wrote in message
om...
Hi All,

Is there a way to have custom calculations in a subtotal. Using Data
-- Subtotal gives you the standard (sum, avg, count, etc.).

Name Sales Hist Sales Sale +/- Hist
---- ----- ---------- -------------
A 5 6 -16.67
Sub Total 5 6 -16.67
B 4 5 -20.00
Sub Total 4 5 -20.00
C 3 2 -50.00
Sub Total 3 2 -50.00
D 1 2 -50.00
Sub Total 1 2 -50.00
Grand Total 13 15 -13.33

Sales and Hist Sales are summed using Excel's built in subtotaling
feature, however, I would like a custom calculation at each subtotal =
(sales-hist sales)/sales*100. All subtotals should be on the same
line. So, the subtotal for sales, hist sales, and sales +/- should be
on the same line. How can I accomplish this? Any help would be much
appreciated.

TIA