# Refrencing a cell in a Index Formula

#### blimes

##### New Member
What I do is pull data from multiple sources on the internet sometimes it can be 500 rows sometimes 10000. I then have a sheet that uses a formula like =INDEX(B1:B10000,MATCH(R2,A1:A10000,0). I can set a cell up in say S1 That tells me there is 600 rows of data. is there a way to reference the 600 in Cell S1 to place the 10000 in the formula.

Thanks

#### Fluff

##### MrExcel MVP, Moderator
=INDEX(INDIRECT("B1:B"&S1),MATCH(R2,INDIRECT("A1:A"&S1),0))

#### arthurbr

##### Well-known Member
Perhaps=INDEX(B1:INDEX(B1:B100000,S1),MATCH(R2,INDEX(A1:INDEX(A1:A100000,S1))),0)

Last edited:

#### blimes

##### New Member
=INDEX(INDIRECT("B1:B"&S1),MATCH(R2,INDIRECT("A1:A"&S1),0))

Thank you much I tried this and it looks like it works now lets see if it speeds up my calculations.

Thanks again

#### Fluff

##### MrExcel MVP, Moderator
Try the formula posted by arthurbr as that is non-volatile & should be better.

#### blimes

##### New Member
Try the formula posted by arthurbr as that is non-volatile & should be better.
I tried but get an error message that i entered too few arguments?

#### Fluff

##### MrExcel MVP, Moderator
Try
=INDEX(B1:INDEX(B1:B100000,S1),MATCH(R2,INDEX(A1:INDEX(A1:A100000,S1),0),0))

#### blimes

##### New Member
Still get the same too few arguments?

#### blimes

##### New Member
Try
=INDEX(B1:INDEX(B1:B100000,S1),MATCH(R2,INDEX(A1:INDEX(A1:A100000,S1),0),0))
Now it is working. Thanks for the help not sure why i was getting error before.

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback

1,078,520
Messages
5,340,941
Members
399,399
Latest member
SravanaSandhya

### This Week's Hot Topics

• Problem with Radio Button's format control
I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
• Last Display on userform to a Listbox
[CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
• Rename and move files to a new location
Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
• Help with True/False Formula
Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
• Clear extra characters from a provided range of cells
Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
• Help with Current and highest streaks
Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...