Oct 17 2022 02:49 AM
I am trying to fetch a value from another sheet in the workbook from a cell which also has a hyperlink embedded. However, VLOOKUP only fetches the text and not the embedded hyperlink. How to get it to fetch the embedded hyperlink?
Oct 17 2022 03:24 AM
@RaeesaB Wrap the VLOOKUP in a HYPERLINK function. Something like this:
=HYPERLINK(VLOOKUP(..............))
Oct 17 2022 03:30 AM
VLOOKUP() or other LOOKUP() functions will only be able to output the displayed text or a value. If your cell content is also the link, e.g. "www.microsoft.com", then you can use the HYPERLINK() function within VLOOKUP().
However, if you use a different text and the hyperlink is not the same as the cell content, then it becomes much more complicated.
A possible approach would be to create the LINK in your source data with the HYPERLINK() function and to search for the coordinates of the cell instead of the cell content with VLOOKUP(). Here you could then read out the hyperlink and the displayed text with FORMULATEXT().
Oct 17 2022 04:19 AM
Thanks! Could you explain your recommendation a bit?
"A possible approach would be to create the LINK in your source data with the HYPERLINK() function and to search for the coordinates of the cell instead of the cell content with VLOOKUP()."
How do you mean? Do you mean my source data should be the URL I want to link to? What would be the purpose of searching for cell coordinates? Which function would I use for this?
Oct 17 2022 05:45 AM
I have made you a small example file that illustrates my solution. In H2 you can search for a link number. In A2:B6 are the data.
With the formula you get the cell entry with the link:
=LET(a,FORMULATEXT(INDIRECT("B"&XMATCH(H2,A2:A6)+1)),HYPERLINK(CHOOSECOLS(TEXTSPLIT(a,CHAR(34)),2),CHOOSECOLS(TEXTSPLIT(a,CHAR(34)),4)))
This only works if you have created the link with the HYPERLINK() function.
I have also made a variant without TEXTSPLIT() and CHOOSECOLS(), in case you don't use such modern Excel version or Excel for the web.
Oct 17 2022 08:54 AM
Oct 18 2022 06:31 AM
Hi! If you haven't found a better solution yet, I can offer you to convert your cells with the links into functions with HYPERLINK(). I have found a macro for this on the net. However, it only works with LibreOffice Calc. I'm sure you can find one for Excel. But since I use Excel for the web, I cannot design / execute macros in Excel.
Copy your cells with the links into a new worksheet and send it to me. I will convert and send it back to you if you want.
It's just an offer to get you started.
Mar 11 2023 12:59 AM
Hi, have you found a solution? I'm also having the same problem here