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,811
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,078,516
Messages
5,340,875
Members
399,396
Latest member
PBE

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top