10

I have a spreadsheet of product ID codes that I'd like to turn into links, and from everything I've read, the concat or concatenate functions in Google Sheets should work for that, but so far everything I try results in an error.

What I want to get:

Brand   Product Code    URL 
AP      X527W           http://example.com/search.php?Code=X527W    
AP      X522M           http://example.com/search.php?Code=X527W
AP      Y500M           http://example.com/search.php?Code=X527W        

What actually happens, when I use the formula:

=concat('http://example.com/search.php?Code=', B2)

or =concatenate('http://example.com/search.php?Code=', B2)

or ='http://example.com/search.php?Code=' & B2

is #Error.

So how do I concatenate strings in Google Sheets?

pnuts
  • 17,883
  • 5
  • 55
  • 103
Kzqai
  • 248
  • 1
  • 3
  • 13

2 Answers2

23

Always enclose string literals in double quotation marks.

= "http://example.com/search.php?Code=" & B2
MetaEd
  • 3,132
  • 2
  • 21
  • 23
4

This works OK for me:

=concatenate("http://example.com/search.php?Code="; B2)
Alex
  • 22,820
  • 12
  • 83
  • 106
mitjajez
  • 41
  • 2