Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default INDIRECT function to reference values in another worksheet

I have multiple worksheets each representing a year. In a summary
sheet I want to return values from each year's worksheet. I'm using
=INDIRECT("'"&A$1&"'!$B5")
in which A$1 returns the year at the top of the summary worksheet
which corresponds to the name of a single year worksheet (e.g. A1
contains "1975", which is also the name of a worksheet). Although this
works and returns the contents of cell B5 in worksheet 1975, my
problem is that when I copy the formula down a column the "$B5"
component doesn't update. So as I move down a column I want the
formula to read:
=INDIRECT("'"&A$1&"'!$B5")
=INDIRECT("'"&A$1&"'!$B6")
=INDIRECT("'"&A$1&"'!$B7") etc, but it remains =INDIRECT("'"&A$1&"'!
$B5").

(The A$1 component updates fine as it moves across rows, e.g. B$1, C
$1, D$1 etc.)

Any ideas?

Many thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default INDIRECT function to reference values in another worksheet

It doesn't change because it is inside quotes, and so gets treated as
if it is text rather than a cell reference. Try something like this:

=INDIRECT("'"&A$1&"'!$B"&ROW(A5))

ROW(A5) will return 5 the first time you use it, but will increment to
ROW(A6), ROW(A7) etc as it is copied down, thus returning 6, 7 etc.

Hope this helps.

Pete

On Feb 1, 12:26*pm, Rich wrote:
I have multiple worksheets each representing a year. In a summary
sheet I want to return values from each year's worksheet. I'm using
=INDIRECT("'"&A$1&"'!$B5")
in which A$1 returns the year at the top of the summary worksheet
which corresponds to the name of a single year worksheet (e.g. A1
contains "1975", which is also the name of a worksheet). Although this
works and returns the contents of cell B5 in worksheet 1975, my
problem is that when I copy the formula down a column the "$B5"
component doesn't update. So as I move down a column I want the
formula to read:
=INDIRECT("'"&A$1&"'!$B5")
=INDIRECT("'"&A$1&"'!$B6")
=INDIRECT("'"&A$1&"'!$B7") etc, but it remains =INDIRECT("'"&A$1&"'!
$B5").

(The A$1 component updates fine as it moves across rows, e.g. B$1, C
$1, D$1 etc.)

Any ideas?

Many thanks.


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
Cell reference OR INDIRECT function Excel ESG Excel Worksheet Functions 2 June 11th 07 11:26 AM
Indirect reference to another worksheet in file MLP Excel Discussion (Misc queries) 1 December 18th 06 10:47 PM
SUM and INDIRECT to reference worksheet Potatosalad2 Excel Discussion (Misc queries) 2 February 28th 06 02:15 PM
Use INDIRECT function to reference a value in closed file Saravan Excel Worksheet Functions 6 June 28th 05 03:04 PM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM


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