Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default monthly cumulative worksheets

I am setting up monthly worksheets in same workbook April 08 - March 09.
The data includes Staff extra hours and staff days off sick.
For the extra hours, I want each month to reference the total for last
month: I can do this manually (using [=]) but I would like a way of doing it
once and copying to the other 11 worksheets.
For the days off sick, I would like each month to show the cumulative total
for the last x months - so June's sheet would show total April + May. Again I
can do this manually but is there a quicker way?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default monthly cumulative worksheets

If you're willing to use a User Defined Function.......

Function PrevSheet(rg As Range)
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function

Say you have 12 sheets, sheet1 through sheet12...........sheet names don't
matter.

In sheet1 you have a formula in A10 =SUM(A1:A9)

Select second sheet and SHIFT + Click last sheet

In active sheet A10 enter =SUM(PrevSheet(A10),A1:A9)

Ungroup the sheets.

Each A10 will have the sum of the previous sheet's A10 plus the sum of the
current sheet's A1:A9


Gord Dibben MS Excel MVP

On Wed, 23 Apr 2008 04:18:01 -0700, Pollyanna
wrote:

I am setting up monthly worksheets in same workbook April 08 - March 09.
The data includes Staff extra hours and staff days off sick.
For the extra hours, I want each month to reference the total for last
month: I can do this manually (using [=]) but I would like a way of doing it
once and copying to the other 11 worksheets.
For the days off sick, I would like each month to show the cumulative total
for the last x months - so June's sheet would show total April + May. Again I
can do this manually but is there a quicker way?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default monthly cumulative worksheets

Thanks very much. I will try this!



"Gord Dibben" wrote:

If you're willing to use a User Defined Function.......

Function PrevSheet(rg As Range)
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function

Say you have 12 sheets, sheet1 through sheet12...........sheet names don't
matter.

In sheet1 you have a formula in A10 =SUM(A1:A9)

Select second sheet and SHIFT + Click last sheet

In active sheet A10 enter =SUM(PrevSheet(A10),A1:A9)

Ungroup the sheets.

Each A10 will have the sum of the previous sheet's A10 plus the sum of the
current sheet's A1:A9


Gord Dibben MS Excel MVP

On Wed, 23 Apr 2008 04:18:01 -0700, Pollyanna
wrote:

I am setting up monthly worksheets in same workbook April 08 - March 09.
The data includes Staff extra hours and staff days off sick.
For the extra hours, I want each month to reference the total for last
month: I can do this manually (using [=]) but I would like a way of doing it
once and copying to the other 11 worksheets.
For the days off sick, I would like each month to show the cumulative total
for the last x months - so June's sheet would show total April + May. Again I
can do this manually but is there a quicker way?



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 Amounts to Annual Monthly Amounts RV Excel Discussion (Misc queries) 0 August 29th 06 04:56 PM
How do I set up monthly random work schedule for 60 hours monthly The Ace of the Base Excel Discussion (Misc queries) 0 April 4th 06 07:36 PM
Need formula for cumulative interest with additional monthly princ Mortgage Man Excel Discussion (Misc queries) 0 October 24th 05 07:39 PM
create yearly summary from monthly worksheets Chys Excel Discussion (Misc queries) 1 September 16th 05 02:54 AM
Mortgage template comparing interest pd, monthly, bi-monthly, ext. JMC Excel Discussion (Misc queries) 0 April 14th 05 02:35 PM


All times are GMT +1. The time now is 02:18 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"