alternative to indirect function

karraj

Board Regular
Joined
Mar 5, 2002
Messages
76
The indirect function is great, but I need to have the workbook I am referencing open in order to use indirect. Is there any alternative, cos I do not want to open the source workbook.
Thanks,
karraj
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi

you could use the INDEX function to point to the data array in the closed file + INDIRECT to pass the row_num and col_num

for example if you have data in WKB1.XLS (the closed file) and in WKB2.XLS A2 the reference to the value in WKB1.XLS, then your formula will look like:

=INDEX([WKB1.XLS]sheet1!$A$1:$C$10,ROW(INDIRECT(A2)),COLUMN(INDIRECT(A2)))

if there is no value in the referenced cell in the closed workbook, you will get a #REF error. This can be prevent with and if statement for example
 
Upvote 0
Hi, jordun,

May I know if INDIRECT function also works with the frist parameter of INDEX function too?
 
Upvote 0
Hi, jordun,

May I know if INDIRECT function also works with the frist parameter of INDEX function too?

Yes it does. It also works within the parameter of Vlookup or Hlookup. The only problem is that INDIRECT has the side-effect of basically turning each cell into a data table that has to be calculated in a more laborious fashion. This can result in slowdown if you are using large tables with many Indirect functions, which I happen to be dealing with right now.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top