9

I imagine this is laughably simple but I just don't know what to do. I have a column (A) of cells with strings in them and I want to simply prepend each string in every cell with a web address:

A
--------
1| /foo/bar/
2| /foo/foo/
3| /foo/baz/
...

I want:

A
--------
1| http://foo.com/foo/bar/
2| http://foo.com/foo/foo/
3| http://foo.com/foo/baz/
...
11

You can do that with a formula, so that e.g. column B will display the URL:

="http://foo.com" & A1

(the & is the string concatenation operator in Google Spreadsheets)

Put this formula in B1, and copy-paste it to other cells in the B column.

5

You can put this in another cell: ="http://foo.com" & A1

This will result in:

  A            | B
----------------------------------------
1| /foo/bar/   | http://foo.com/foo/bar/
2| /foo/foo/   | http://foo.com/foo/foo/
3| /foo/baz/   | http://foo.com/foo/baz/

Or, if you prefer, you can use the CONCATENATE function:

=CONCATENATE("http://foo.com",A1)

(CONCAT is the same, but it only concatenates two values, while CONCATENATE lets you do multiple, even in ranges.)

5

For completeness, use this formula to add in B1:

=ARRAYFORMULA("http://foo.com" & A1:A)

See similar post here on Web applications: CONCATENATE a string with an ArrayFormula

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.