InDirect Formula HELP

ItalianPlatinum

Well-known Member
Joined
Mar 23, 2017
Messages
793
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello - having some trouble putting an indirect formula together to pull my formulas. Case scenario is my A2 could change so I need it to reference off a cell. But my B2:C2 i want to set them as fixed in the path. I keep getting the below error, is there something I am doing wrong?

Book2
ABC
1Workbook PathFixed File NameCell Range
2C:\Users\Marco\Desktop\VBA TESTING.xlsmJ:L
3
4#NAME?
5
6Desired:[VBA TESTING.xlsm]Sheet1'!$J:$L
Sheet1
Cell Formulas
RangeFormula
A4A4=INDIRECT("'["&A2&VBA Testing.xlsm&"]"&"Sheet1"&"'!"&"J:L")
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try

=INDIRECT("'["&A2&B2&"]Sheet1'!"&C2)

It should return a #VALUE! error because you're trying to return 2 entire columns to a single cell. If you want to check that INDIRECT is returning the correct range, the easiest way is to test it without the INDIRECT() part, for example

="'["&A2&B2&"]Sheet1'!"&C2
 
Upvote 0
Try

=INDIRECT("'["&A2&B2&"]Sheet1'!"&C2)

It should return a #VALUE! error because you're trying to return 2 entire columns to a single cell. If you want to check that INDIRECT is returning the correct range, the easiest way is to test it without the INDIRECT() part, for example

="'["&A2&B2&"]Sheet1'!"&C2
This is my issue to clarify trying to do a Vlookup, encompassing the ask above. getting REF#, also am i missing brackets? See below:

Book2
ABC
1Workbook PathFixed File NameCell Range
2C:\Users\Marco\Desktop\VBA TESTING.xlsmJ:K
3
4INDIRECT FORMULA#REF!Vlookup result
54
6TEST'[C:\Users\Marco\Desktop\VBA TESTING.xlsm]Sheet1'!J:K
Sheet1
Cell Formulas
RangeFormula
B4B4=INDIRECT("'["&A2&B2&"]Sheet1'!"&C2)
C5C5=VLOOKUP(E2,'C:\Users\Marco\Desktop\[VBA TESTING.xlsm]Sheet1'!$J:$K,2,FALSE)
B6B6="'["&A2&B2&"]Sheet1'!"&C2
 
Upvote 0
oops, the bracket wasn't missing, I just had it in the wrong place, it should be =VLOOKUP(E2,INDIRECT("'"&A2&"["&B2&"]Sheet1'!"&C2),2,FALSE)

Although, =VLOOKUP(E2,INDIRECT("'["&B2&"]Sheet1'!"&C2),2,FALSE) should be adequate.

When using INDIRECT, the workbook that the data is being pulled from must be open.
 
Upvote 0
oops, the bracket wasn't missing, I just had it in the wrong place, it should be =VLOOKUP(E2,INDIRECT("'"&A2&"["&B2&"]Sheet1'!"&C2),2,FALSE)

Although, =VLOOKUP(E2,INDIRECT("'["&B2&"]Sheet1'!"&C2),2,FALSE) should be adequate.

When using INDIRECT, the workbook that the data is being pulled from must be open.
oh darn. that could be a problem. hmm. the above does work but as you said yes it does have to be open
 
Upvote 0

Forum statistics

Threads
1,215,497
Messages
6,125,158
Members
449,208
Latest member
emmac

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