Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default making a portion of reference to a worksheet variable in a formula

How do I make a portion of a worksheet reference variable.

For example I am linking to a file that has multiple worksheets and I am
getting the same data from each sheet. I want to be able to in my formula
link to a column that has the a portion of the worksheet name in it. For
example, column A would list numbers 1 thru 10 and my worksheet name are H1,
H2, H3 .... H10.

Depending on what is in column A determines what worksheet the formula pulls
from.

I am using a two way table lookup so I am using index function & Match like
the following and I want to make the 10 after the H variable (dependent on
what is in column A) . How do I do that



=INDEX('[filename.xls]H10'!$c$1:$g6,MATCH(j5,'[filename.xls]H10'!$c$1:$c$6,0),MATCH(j6,'[filename.xls]H10'!$c$5:$g$5,0))


--
Celia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default making a portion of reference to a worksheet variable in a formula

Cell A1 = 1 to 10, with cell A1 = 10

Try the below formula
=INDEX(INDIRECT("'[filename.xls]H" & A1 & "'!$c$1:$g6"),
MATCH(j5,INDIRECT("'[filename.xls]H" & A1 & "'!$c$1:$c$6"),0),
MATCH(j6,INDIRECT("'[filename.xls]H" & A1 & "'!$c$5:$g$5"),0))

You can get the same result using VLOOKUP() and MATCH()

=VLOOKUP(J5,INDIRECT("'[filename.xls]H" & A1 & "'!$c$1:$g6"),
MATCH(J6,INDIRECT("'[filename.xls]H"&A1&"'!$c$5:$g$5"),0),0)

If this post helps click Yes
---------------
Jacob Skaria


"Celia" wrote:

How do I make a portion of a worksheet reference variable.

For example I am linking to a file that has multiple worksheets and I am
getting the same data from each sheet. I want to be able to in my formula
link to a column that has the a portion of the worksheet name in it. For
example, column A would list numbers 1 thru 10 and my worksheet name are H1,
H2, H3 .... H10.

Depending on what is in column A determines what worksheet the formula pulls
from.

I am using a two way table lookup so I am using index function & Match like
the following and I want to make the 10 after the H variable (dependent on
what is in column A) . How do I do that



=INDEX('[filename.xls]H10'!$c$1:$g6,MATCH(j5,'[filename.xls]H10'!$c$1:$c$6,0),MATCH(j6,'[filename.xls]H10'!$c$5:$g$5,0))


--
Celia

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
Making part of a formula a variable Will Fleenor Excel Worksheet Functions 2 August 14th 09 01:19 PM
Using a variable spreadsheet reference in a formula 3Nails Excel Discussion (Misc queries) 6 October 26th 08 12:45 AM
Variable column reference in formula excel help acct[_2_] Excel Discussion (Misc queries) 2 January 16th 08 12:31 AM
Vlookup with variable worksheet reference trempnvt Excel Worksheet Functions 6 May 23rd 06 06:47 PM
Making a file and worksheet reference into a variable.... Mr Mike Excel Worksheet Functions 3 July 6th 05 08:52 PM


All times are GMT +1. The time now is 11:14 PM.

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

About Us

"It's about Microsoft Excel"