Question : Auto Create Excel Total Rows

I've got a worksheet with 500 rows, one column of string id info and another column of numeric values.    The id info is divided into four values only.

Is there an automagic way to select this data and get Excel to add sum rows for each different set of id values?   I mean, I recognize this would require sorting it, adding sum rows, and setting up the sums with the proper ranges, all of which is do-able in vba...just wondering if there was a simpler approach (mostly in terms of doing the sum ranges, rather than the "long" drag and select)

Any quidance on this would be appreciate.   "Never have seen such" from experienced EE's would probably suffice.

Thanks!

Answer : Auto Create Excel Total Rows

Hi Codequest...

You can do this in two simple steps...

1...Select your range as in A Column assuming you have string ids there..and sort it either ascending or descending order...
2...Go to Data-->Subtotal-->Then it will give following options-->
                             a...At each change at string Id...
                             b...Use function....-->Sum...
                             c...Add subtotal to values...

and Hit ok...and you would be good to go...

Second way to do the same is by pivot table...

1...Select your data....
2...Go to data-->pivot and wizard..Hit Next...In which data to use...you would have already your data selected...Hit next...Then click layout and in row drag your string id there...and in data drag your value there and choose condition sum...hit Ok...and then click finish....and you would see a new sheet with pivot showing sum of the values in it...

Saurabh...
Random Solutions  
 
programming4us programming4us