Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenate function in Excel 2010 to add single quotes and commas

Tags:

excel

I am working on a loaner laptop and have found that the concatenate function I have used to add single quotes and a comma to a column of text is no longer working. I need this to bring a series of IDs into a SQL query. The function I have used for years is =concatenate("'",A1,"',") to get a result of 'A1',. This is in Microsoft Excel 2010.

like image 815
ero Avatar asked Mar 26 '17 12:03

ero


2 Answers

Use Excel Characters. In your case it would be :

= concatenate(CHAR(39),A1,CHAR(39))

To get the result = 'A1'

similarly, you can include other special charterers as well. Like to include space you need to use CHAR(32).

like image 155
rahul pareek Avatar answered Mar 07 '23 14:03

rahul pareek


Try the following as an alternative to =concatenate():

="'"&A1&"',"

I've been using the above to do exactly what you're trying to accomplish.

like image 42
Andrew L Avatar answered Mar 07 '23 16:03

Andrew L