ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding Formula's (https://www.excelbanter.com/excel-programming/272995-adding-formulas.html)

Dan[_18_]

Adding Formula's
 
I use a macro to filter a range of cells where column A
contains dates (each 1 week apart), then pastes it to
another worksheet. The macro then adds 2 blank rows at
the end of each row of cells in Col. A that has a
different month. Everything works fine until I attempt to
add a formula to "AVERAGE" the rows in columns C-N,
and "SUM" the rows in columns O-W.
Anyone have any idea's on how to write the code so that it
only sums and averages the rows for each month
(separately)? The following is an example of how I am
trying to get the report to look like:
A B C D E F G H I
1 Period AtBats Hits RBI Sin. Doub Trip HR's K's
2 1/2 12 4 1 2 1 0 1 2
3 1/9 16 5 1 4 0 1 0 5
4 1/16 12 2 0 2 0 0 0 3
5 1/23 14 1 0 0 1 0 0 6
6 1/30 13 3 0 1 1 0 1 2
7 JAN-02 (avg) (avg) (sum) (sum) (sum) (sum)(sum) (sum)
8
9 2/6 15 4 0 4 0 0 0 2
10 2/13 8 3 0 1 2 0 0 0
11 2/20 10 3 1 2 1 0 0 2
12 2/27 12 5 2 2 1 1 1 1
13 FEB-02 (avg) (avg) (sum) (sum) (sum) (sum)(sum) (sum)
14


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com