Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jeff Lowenstein
 
Posts: n/a
Default How to use a variable for a range

What I am trying to do is lookup data in the 2 column of a different
workbook. This data is organized as follows:
John Smith
Day spot trial ...
Fri 7/1
Sat 7/2
Sun 7/3

John Doe
Day spot trial ...
Fri 7/1
Sat 7/2
Sun 7/3

What I have to do first is find the name ( ex: John Smith), and then find
the correct day in his section of the data, and return the value. I've found
and got the row information for both the name, and the date cells. ex: A7
and A33. What I am having a hard time doing is using these values as the
range values in either a index, or vlookup statement.
i.e. cell A34 = 7 - row where the name was found
Cell A54 = 33 - row where the date was found.

What I want to do is something along the order of this:
INDEX(SPREADSHEET2!A34:F54,MATCH(NAMECELL,SPREADSH EET2!A34-A54),2)

Where the 34'S and 54'S are variables. Is this even possible?
  #2   Report Post  
JMB
 
Posts: n/a
Default

You could try the INDIRECT function,


INDIRECT("SPREADSHEET2!A"&A1&":F"&A2)

where cell A1 and A2 contain the beginning and ending row numbers. Or, if
these are the result of other functions you are using to find the row
numbers, you could replace A1 and A2 with your functions and just use one
large formula.



"Jeff Lowenstein" wrote:

What I am trying to do is lookup data in the 2 column of a different
workbook. This data is organized as follows:
John Smith
Day spot trial ...
Fri 7/1
Sat 7/2
Sun 7/3

John Doe
Day spot trial ...
Fri 7/1
Sat 7/2
Sun 7/3

What I have to do first is find the name ( ex: John Smith), and then find
the correct day in his section of the data, and return the value. I've found
and got the row information for both the name, and the date cells. ex: A7
and A33. What I am having a hard time doing is using these values as the
range values in either a index, or vlookup statement.
i.e. cell A34 = 7 - row where the name was found
Cell A54 = 33 - row where the date was found.

What I want to do is something along the order of this:
INDEX(SPREADSHEET2!A34:F54,MATCH(NAMECELL,SPREADSH EET2!A34-A54),2)

Where the 34'S and 54'S are variables. Is this even possible?

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
Variable Input Range for Combo Box Defoes Right Boot Excel Worksheet Functions 2 July 20th 05 03:44 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Discussion (Misc queries) 1 March 9th 05 11:41 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Worksheet Functions 3 March 9th 05 11:40 PM
empty variable range S1 Excel Discussion (Misc queries) 5 January 28th 05 02:33 PM
variable range countif JK Excel Worksheet Functions 3 November 3rd 04 07:50 AM


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