?
Solved

Excel 2010 INDIRECT not working

Posted on 2013-01-03
9
Medium Priority
?
1,110 Views
Last Modified: 2013-01-03
Please help, I cannot seem to get the INDIRECT formula to work...

I currently have:
=INDIRECT("'["&INDIRECT("A1")&".xlsx]"&INDIRECT("A2")&"'!"&INDIRECT("A3"))

The value in A1 is     C:\Users\me\Desktop\test-variable values
The value in A2 is     test-variable values
The value in A3 is     w1

The file being references is open, but I just get #REF!

Thank you, if you can help!!!
0
Comment
Question by:BEBaldauf
  • 4
  • 3
  • 2
9 Comments
 
LVL 13

Expert Comment

by:Shanan212
ID: 38740873
="["&INDIRECT("A1")&".xlsx]"&INDIRECT("A2")&"'!"&INDIRECT("A3")

Open in new window


Try above

What are you trying to do?
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 38740877
You should only need a single INDIRECT function and you don't use quotes around the cell references, i.e.

=INDIRECT("'["&A1&".xlsx]"&A2&"'!"&A3)

regards, barry
0
 

Author Comment

by:BEBaldauf
ID: 38740901
I'm trying to simply get the contents of cell W1 out of the workbook being referenced.  (first step in a process)

Neither suggestion worked.
Shanan212,  your formula returned the string:   [C:\Users\bbaldauf\Desktop\test-variable values.xlsx]test-variable values'!w1
Barry, your formula returned #REF!

Any other suggestions?
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 13

Expert Comment

by:Shanan212
ID: 38740963
=INDIRECT("'"&INDIRECT("A1")&"["&INDIRECT("A2")&".xlsx]"&INDIRECT("A3")&"'!"&INDIRECT("A4"))

Open in new window


This works as long as workbook is open
0
 

Author Comment

by:BEBaldauf
ID: 38740973
Still getting #REF!
0
 
LVL 13

Accepted Solution

by:
Shanan212 earned 2000 total points
ID: 38740974
=INDIRECT("'"&INDIRECT("A1")&"["&INDIRECT("A2")&".xlsx]"&INDIRECT("A3")&"'!"&INDIRECT("A4"))

Open in new window


This works as long as workbook is open. Below are values from A1 - A4
A1 - path
A2 - file name
A3 - sheet name
A4 - cell

C:\Users\me\Desktop\test-variable values\
test-variable values
test-variable values
W1
0
 

Author Comment

by:BEBaldauf
ID: 38740981
HEY!  You're awesome!  That did it!
MUCH APPRECIATED!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 38740983
The best way to do this is for you to do this is probably to work out what the whole reference should be. Open the source file, and then in the formula worksheet type = in a cell then select the cell you need from the source workbook - that will give you the reference. You can then build that path with INDIRECT function

Do you know the required reference - if the file is open I doubt you need the whole path?

regards, barry
0
 

Author Closing Comment

by:BEBaldauf
ID: 38740987
SUPER AWESOME, PATIENT, FAST, PERFECT!!!!!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
I came across an unsolved Outlook issue and here is my solution.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question