-1

I know you can use the concatenate function in excel to combine two strings in two different cells into one cell, but how do I do the same for cells with numbers in them? I have two columns as seen in the image below (I have started the process by hand to demonstrate what I want) and I want to concatenate the value to read into R to perform a choice experiment evaluation on the data but using concatenate sums the values.

enter image description here

3
  • If you are going to use R, why don't you do every step in R?
    – zx8754
    Mar 12, 2015 at 21:48
  • I have no idea what I was doing wrong at first, it was concatenating 1 and 1 and made 2? And because the data sheet needed alot of changes at the start and it made more sense to do everything in excel and have a clean data sheet to use in R than arbitrarily draw a line of when to do things in R and things in excel
    – PaulBarr
    Mar 12, 2015 at 21:58
  • Found the problem I had originally, when you choose the default concatenate and click the cells you want to concatenate it sums the cells by default, end of a long day I think
    – PaulBarr
    Mar 12, 2015 at 22:42

2 Answers 2

3

You can also do the concatenation within R itself, by setting the column type to string, and then using the paste0(string1, string2) function.

0

You can use the & sign

=A1&C1

concatenate does also work in excel

=CONCATENATE(A1,C1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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