Summing

L

LC

Hi,

Lets say:
A B C D E F G H I J
1 Pets cats 1 23 2 4 23 45 43 23
2 Pets cats 3 4 2 5 67 23 23 23
3 Pets dogs 2 2 3 4 34 23 23 23
4 Pets dogs 4 5 13 4 34 23 23 23

Ok, I would like to insert a new row for the totals of row
1 and 2 and insert another row for the totals of row 3 and
4 and then a new row for totals of all the rows. I have to
use a formula b/c I want the totals to update if the
values were change for cats in either column C to J.

Goal:

A B C D E F G H I J
1 Pets cats 1 23 2 4 23 45 43 23
2 Pets cats 3 4 2 5 67 23 23 23
total for cats...
3 Pets dogs 2 2 3 4 34 23 23 23
4 Pets dogs 4 5 13 4 34 23 23 23
total for dogs
total for Pets

After all this is done, let's say I want to insert a new
row for the total of all cats with white hair within the
rows 1 and 2. Will this mess up the other formulas?

Ok, I hope this clears everything up!
Thank you very much,
LC
 
A

acw

LC

Have a look at the Data, Subtotals options. You can
generate a subtotal / total based on the change in Column
A, then add a second which will be based on the change in
Column B. Change any of the numbers in C - J and the
totals will update.


Tony
 
L

LC

Hi,

I was wondering if I can change the columns that will be
subtotaled b/c the excel that I'll working on will have
different columns and I tried everything but it still
doesnt work. This is what i have but doesnt work:

Dim text As String
text = "8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18"
Dim grp As Integer
grp = 2
ActiveCell.Range("A2").Select
Selection.subtotal GroupBy:=grp, Function:=xlSum,
TotalList:=Array(text), Replace:=False,
PageBreaks:=False, _
SummaryBelowData:=True

Please Help me
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top