Refrencing a cell in a Index Formula

blimes

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

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,824
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,932
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
19
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
35,824
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
35,824
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
35,824
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,089,886
Messages
5,410,990
Members
403,336
Latest member
amreeves87

This Week's Hot Topics

Top