Anytime you sort - you need to make sure you are sorting the proper range.
Say you have a table with headers on Row 2 starting in column D thru column
J.
Your data is in cells D3:J20; Row 21 in columns H, I, and J has
=sum(h3:h20)...
Before performing a sort - click anywhere INSIDE the table (click on any
cell containing
your data - Excel guesses at the "table-range capable of being sorted" and
often times you can go ahead and proceed, but I prefer to not leave
"things" open to chance, so I
instruct or tell Excel what my range is (and in your case example above - by
performing the following...) Click on D2 and drag the mouse over to column
J then down to Row 20 highlighting D2:J20 or making it the current
selection;
Then go to the menu select Data, sort - look carefully at the settings excel
has automatically assigned (this is your job!!) - note that the button at
the bottom "header-row" is checked..
Perform the sort.
Everything ***all your data*** should stay together/intact only sorted as
you wanted;
even the sums should be fine as they were "omitted" from the sort..
HTH
Jim May