Would anyone be able to explain why a formula doesn’t work when I use a concatenate but works when I don’t.

Carty

Board Regular
Joined
Mar 3, 2009
Messages
76
Hi

This should be simple but I am finding it baffling

The formula that works:
Code:
=Match(B4,'\\network address\folder\[file.xlsx]sheet'!$E:$E,)
I get the result 12. My understanding is that this is the row which the value of B4 on the current sheet is found in column E on the specified (different) sheet.

However I would like to use a cell reference on the current sheet to determine the sheet on which to look by using
Code:
=Match(B4,Concatenate("'\\network address\folder\[file.xlsx]",D4&" Text","'!",”$E:$E”),)
It gives me a #VALUE error and I don’t know why.

Stripping out the Concatenate part of the formula it gives me, I believe, the correct format i.e.

Code:
=Concatenate("'\\network address\folder\[file.xlsx]",D4&" Text","'!",”$E:$E”),)
Gives me '\\network address\folder\[file.xlsx]D4 Text'!$E:$E where "D4 Text" is the sheet name, which matches the format in the formula above.

Any enlightenment gratefully received

Thanks

Paul
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,983
Because when you explicitly defined the workbook path and name, it was an address, and Excel was able to resolve it. When you use CONCATENATE, you are creating a text string, not an address. It looks like an address, but it's not. In order to convert a text to an address, you can surround it with the INDIRECT function. However, more bad news, INDIRECT does not work on closed workbooks. In order to do what you want, you may need to use VBA in some form.
 

Carty

Board Regular
Joined
Mar 3, 2009
Messages
76
Thank you, Eric W, for enlightening me. Not so much for creating more problems ;)
 

Forum statistics

Threads
1,082,119
Messages
5,363,268
Members
400,723
Latest member
Jsdk

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