The easiest way, for me, is a macro. The following Excel 2003 macro will sum the first 5 cells in Column A on Sheet1 and place the total in the first cell in Column B on Sheet2. The next 5 cells will be totaled and placed in cell B2, and so on. If you have 23 numbers in the first sheet, the last total will be the last 3 numbers.
If you are not using Columns A & B, change the range references in the macro before copying. Replace the "B:B' in line 9 of the macro to the Column reference for your totals in Sheet2. Also, in Line 18 change the B in 'B65536' to your Sheet2 'totals' column reference.
Replace the 'A' in Line 12 with the Column reference of your data in Sheet1. Change both references in the line.
Open your workbook.
Copy the macro to the clipboard.
Sub Sum_By_Group()
Dim rng As Range
Dim ctr, mysum
Dim rwSet
rwSet = 0
ctr = 0
Application.ScreenUpdating = False
Sheets("Sheet2").Select
Columns("B:B").Select
Selection.ClearContents
Sheets("sheet1").Select
Set rng = Range("A1:" & Range("A65536"). _
End(xlUp).Offset(2, 0).Address(0, 0))
For Each cell In rng
cell.Select
If ctr = 5 Then
Sheets("sheet2").Select
Range("B65536").End(xlUp). _
Offset (rwSet, 0).Select
ActiveCell.Value = mysum
Sheets("sheet1").Select
ctr = 1
mysum = ActiveCell.Value
rwSet = 1
Else
ctr = ctr + 1
mysum = mysum + ActiveCell.Value
End If
Next
Application.ScreenUpdating = True
End Sub
Press ALT + F11
Insert > Module
Paste the macro into the Module area to the right.
Close back to Excel
Go to Tools > Macro > Macros
Click: Options
Select a letter to be used as a keyboard shortcut.
Close back to Excel.
To run the macro, press CTRL + your shortcut letter.
Note: This macro was tested extensively and performs correctly in Excel 2003.