teo
teo

Reputation: 21

How to concatenate string in hyperlink function

I would like to add a column in my OpenOffice Calc spreadsheet.
In particular, this column should contain a hyperlink to a query on Google.

For example: if in A1 I have the string "The gladiator", I would like have column B1:

"www.google.it?q=The Gladiator"

So I can click and open the browser to see how that "film" is (yes, it is a simple film database).

Thank you!

Upvotes: 2

Views: 6492

Answers (2)

mechanical_meat
mechanical_meat

Reputation: 169414

You have two options:

The & operator:

=hyperlink("http://www.google.com/search?q="&A1)

or the concatenate() function:

=hyperlink(CONCATENATE("http://www.google.com/search?q="; A1))

The HYPERLINK() function handles URL encoding for you.

Upvotes: 3

Dave K
Dave K

Reputation: 11

Excellent Answer: Use & or Concatenate function.

Let me add, the proper connector is semi-colon, not comma...

Also, I would recommend using the film title as the celltext, to avoid having the literal hyperlink display in the column b cell.

=hyperlink("http...?q="&a1;a1)

=hyperlink(CONCATENTATE("http...?q=";a1);a1)


I am using this exact function (different target URL) and am trying to get the new page to launch in the same window as the previous, to avoid having to click the X in the corner (talk about lazy).

Upvotes: 1

Related Questions