Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Refer to the previous worksheet in a formula

I have a workbook in which a new worksheet is created each week based on a
copy of the previous week. The sheets are named from 1 to 52. Is there any
way I can refer to last week's sheet in a formula. If I was to refer to the
sheet's name I would have to update the formulas each week to refer to the
next number which I would rather avoid doing.

Thank you in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Refer to the previous worksheet in a formula

Use the indirect function.

On your sheet you will need a reference to this week number
say it is in A1
and the cell you want is B1.

Sheet1!a1="2"
Sheet1!b1=if(a1=1,0,INDIRECT("Sheet"&A1-1&"!C1"))
Sheet1!c1="10"

Sheet2!a1="1"
Sheet2!b1=if(a1=1,0,INDIRECT("Sheet"&A1-1&"!B1"))
Sheet2!c1="20"

You can then use this on all sheets even the first one.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"Shazzer" wrote:

I have a workbook in which a new worksheet is created each week based on a
copy of the previous week. The sheets are named from 1 to 52. Is there any
way I can refer to last week's sheet in a formula. If I was to refer to the
sheet's name I would have to update the formulas each week to refer to the
next number which I would rather avoid doing.

Thank you in advance

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Refer to the previous worksheet in a formula

One method to do this is to use the indirect() function when you need to
refer to the previous sheet.
for example
say you call your sheets "week 01" etc

Set up a cell for reference (Say A1)
when you generate the new sheet
change Cell A1 to reflect the old sheet
for example in week 06 enter week 05
put equations such as
=indirect("'"&A1&"'!D3")
if you want to pull in the value from D3 in week 05 sheet

"Shazzer" wrote:

I have a workbook in which a new worksheet is created each week based on a
copy of the previous week. The sheets are named from 1 to 52. Is there any
way I can refer to last week's sheet in a formula. If I was to refer to the
sheet's name I would have to update the formulas each week to refer to the
next number which I would rather avoid doing.

Thank you in advance

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Refer to the previous worksheet in a formula

Thank you both so much for taking the time to reply. I hadn't heard of the
INDIRECT function before. It worked an absolute treat.

Thank you
Sharon
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
COMBINATION FORMULA Johnny Excel Discussion (Misc queries) 5 September 22nd 06 08:41 PM
How:Add New Worksheet that copies the cell of the previous sheet JLM Excel Worksheet Functions 1 August 24th 06 08:04 PM
Updating Info from a previous worksheet Tara working away Excel Worksheet Functions 0 August 10th 06 10:18 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula to refer to other worksheet... Liz-In-USA Excel Worksheet Functions 4 November 9th 04 10:51 PM


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