Refrencing a cell in a Index Formula

blimes

New Member
Joined
Jan 6, 2016
Messages
17
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
Adam
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,315
Office Version
365
Platform
Windows
How about
=INDEX(INDIRECT("B1:B"&S1),MATCH(R2,INDIRECT("A1:A"&S1),0))
 

arthurbr

Well-known Member
Joined
Dec 8, 2006
Messages
1,919
Perhaps=INDEX(B1:INDEX(B1:B100000,S1),MATCH(R2,INDEX(A1:INDEX(A1:A100000,S1))),0)
 
Last edited:

blimes

New Member
Joined
Jan 6, 2016
Messages
17
How about
=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
Joined
Jun 12, 2014
Messages
32,315
Office Version
365
Platform
Windows
Try the formula posted by arthurbr as that is non-volatile & should be better.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,315
Office Version
365
Platform
Windows
Try
=INDEX(B1:INDEX(B1:B100000,S1),MATCH(R2,INDEX(A1:INDEX(A1:A100000,S1),0),0))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,315
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,082,257
Messages
5,364,074
Members
400,778
Latest member
Canadian Sal

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top