Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Monthly average calculations

Hi

I have a sheet containing a full years data: columns conatining parameters
and rows containing recordsets per day of the year.
I have a button that hides rows per a month selection in a combo box. I
want to calculate averages for all the columns for a specific month. This
must be displayed in the last row - this actually being the empty row below
the 31 Dec 2005. This row is vissible at the bottom of each displayed month.

When I just put a function in there it only calcualtes the average for a
fixed number of rows. How do I change it that it calculates the average
dynamicaly as per the month selected.

This is to enable a monthly report to be printed out that shows average at
the bottom of each column.

thanks
Francois
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Monthly average calculations

Hi

For example for column C with data in range C2:C367 ( a spare row for leap
year)
=SUBTOTAL(1;$C2:$C367)


--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Francois" wrote in message
...
Hi

I have a sheet containing a full years data: columns conatining parameters
and rows containing recordsets per day of the year.
I have a button that hides rows per a month selection in a combo box. I
want to calculate averages for all the columns for a specific month. This
must be displayed in the last row - this actually being the empty row

below
the 31 Dec 2005. This row is vissible at the bottom of each displayed

month.

When I just put a function in there it only calcualtes the average for a
fixed number of rows. How do I change it that it calculates the average
dynamicaly as per the month selected.

This is to enable a monthly report to be printed out that shows average at
the bottom of each column.

thanks
Francois



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Monthly average calculations

Hi

A notation: I'm not sure how SUBTOTALS work when you hide rows through
code - depends on how you do the hidding I think. The formula works for
sure, when Autofilter is used to hide rows.


Arvi Laanemets


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Monthly average calculations

Hi Francois,

Assuming the data to be summed is in A1:An, and the date for the month to
test against is in B1, try this

=SUM(INDIRECT("A"&DATE(YEAR(B1),MONTH(B1),1)-DATE(YEAR(B1),1,0)&":A"&DATE(YE
AR(B1),MONTH(B1)+1,1)-DATE(YEAR(B1),1,1)))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Francois" wrote in message
...
Hi

I have a sheet containing a full years data: columns conatining parameters
and rows containing recordsets per day of the year.
I have a button that hides rows per a month selection in a combo box. I
want to calculate averages for all the columns for a specific month. This
must be displayed in the last row - this actually being the empty row

below
the 31 Dec 2005. This row is vissible at the bottom of each displayed

month.

When I just put a function in there it only calcualtes the average for a
fixed number of rows. How do I change it that it calculates the average
dynamicaly as per the month selected.

This is to enable a monthly report to be printed out that shows average at
the bottom of each column.

thanks
Francois



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rolling Monthly Average mem Excel Discussion (Misc queries) 1 February 13th 09 04:40 PM
Rolling 12 Monthly Average mem Excel Discussion (Misc queries) 0 February 13th 09 04:36 PM
Rolling Monthly Average Colin Hayes Excel Worksheet Functions 5 July 31st 08 01:02 PM
Monthly Average in a PivotTable Pflugs Excel Discussion (Misc queries) 0 August 23rd 07 06:40 PM
Find monthly average but have average automatically configured kimbafred Excel Discussion (Misc queries) 2 August 8th 07 12:28 AM


All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"