#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Sum Function

I have 12 different worksheets for each month in a year in one workbook. In
each month's worksheet, I want year-to-date figures up to that month. All
the worksheets have the same fields in same cells. I prepare one worksheet
with all data and formulas for one month. Then I name the worksheet "Jan"
for January and copy that worksheet 11 times and rename them according to
individual months.

How can I insert a common formula that will work in every worksheet for
getting the year-to-date figures in each month's worksheet?

Thanks in advance for your time.

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

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 Mon, 10 Mar 2008 16:46:00 -0700, Roger
wrote:

I have 12 different worksheets for each month in a year in one workbook. In
each month's worksheet, I want year-to-date figures up to that month. All
the worksheets have the same fields in same cells. I prepare one worksheet
with all data and formulas for one month. Then I name the worksheet "Jan"
for January and copy that worksheet 11 times and rename them according to
individual months.

How can I insert a common formula that will work in every worksheet for
getting the year-to-date figures in each month's worksheet?

Thanks in advance for your time.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Sum Function

Let's say that in each sheet the monthly value is in B9 and we want the cumm
to date in B10.

In Feb sheet in cell B10 enter:
=B9+Jan!B10

In the Mar sheet in B10 enter:
=B9+Feb!B10

etc.


B10 builds cummulatively month-by-month

--
Gary''s Student - gsnu200772


"Roger" wrote:

I have 12 different worksheets for each month in a year in one workbook. In
each month's worksheet, I want year-to-date figures up to that month. All
the worksheets have the same fields in same cells. I prepare one worksheet
with all data and formulas for one month. Then I name the worksheet "Jan"
for January and copy that worksheet 11 times and rename them according to
individual months.

How can I insert a common formula that will work in every worksheet for
getting the year-to-date figures in each month's worksheet?

Thanks in advance for your time.

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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 09:47 PM.

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"