Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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/
...
share|improve this question
    
possible duplicate of CONCATENATE a string with an ArrayFormula –  Jacob Jan Tuinstra Feb 19 at 15:53
add comment

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
add comment

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.)

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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