Sum Question


Posted by Andonny on December 30, 2000 3:31 PM

Hi,
I am looking for a macro which adds up culumn B and Culumn C and places the SUM 2 cells below the last number to be added. There are sometimes few rows and somtimes more of them.
Sample:
........A...........B..........C
1....Apple..........1..........3
2....Kiwi...........7..........102
4....Beer...........6..........345
5....Wine...........100........151
6....Banana.........500........176
7....Orange.........101........145
8....Tomato.........230........121
9....Champagne......11.........132

................... 956........1175

Thanks for your help in advance
Andonny



Posted by Aladin Akyurek on December 30, 2000 4:37 PM

While you're not asking for formulas, I feel tempted to propose a formula-based solution.

Put in the cell where 956 must appear

=SUM(INDIRECT(ADDRESS(ROW(B1),COLUMN(B1))&":"&ADDRESS(ROW()-2,COLUMN())))

and where 1175 must appear

=SUM(INDIRECT(ADDRESS(ROW(c1),COLUMN(c1))&":"&ADDRESS(ROW()-2,COLUMN())))

Aladin