# Subtotal Question

#### lhernandez

##### Active Member
I have a worksheet with approx. 900 lines. There are different ranges within column B that are summed together. Is there any easy way to get a grand total from all the summed ranges rather than selecting each summed range and adding it into a formula?

### Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

#### yee388

##### Well-known Member
There are many ways to do what you're wanting, but to pick the best one, we'd have to know more about how your sheet is structured.

i.e. Have you labeled the Subtotal rows somehow? Are the subtotals based on other criteria in other columns? Have you thought about a Pivot table?

#### lhernandez

##### Active Member
The sheet is broke up into four columns 1. Code 2. Title 3. Quantity 4. Unit. The subtotal is by Code & Quantity. I want the subtotal for quantity to total everything that has a measure of feet or meters, anything else should not be totaled. and the grand total for the entire page should only be what was totaled through each section.
Does this help?

#### yee388

##### Well-known Member
Sorry... I think I understand most of it except for this:

The subtotal is by Code & Quantity.

Are you able to post a snapshot of part of the sheet? Also, it really sounds like a Pivot Table would come in handy here, and you tried that solution?

#### lhernandez

##### Active Member
well i have already used a pivot table to to put the data in this chart. Refering to your quote, sorry for the confusion, I meant that I have subtotaled based on the quantity.
For ex: there are 20 different codes in column A and I am subtotaling for each different code. So this would leave 20 subtotals. And I would like only the 20 codes that have been subtotaled to be included in my grand total without having to use =sum(xx,xx,xx,xx)...
Any help would be great
thank you

#### yee388

##### Well-known Member
If you put the word "Subtotal" in the subtotal rows, you can use something simple like =SUMIF(A:A,"Subtotal",C:C), changing the ranges to fit your needs.

#### lhernandez

##### Active Member
thank you, that was exactly what i was looking for.

Replies
2
Views
187
Replies
3
Views
154
Replies
2
Views
458
Replies
5
Views
133
Replies
5
Views
309

1,195,597
Messages
6,010,641
Members
441,558
Latest member
lambierules

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back