Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel concatenation quotes

Tags:

excel

vba

I'm trying to concatenate several fields and want certain fields to start and end with quotes ("....."). When I put a cell (B2) inside this, the cell (B2) is shown as plain text with quotes around it.

CONCATENATE("""B2""") -> "B2"

CONCATENATE("""B2""") -> "(whatever is in cell B2)"
like image 527
CustomX Avatar asked Sep 05 '25 09:09

CustomX


2 Answers

Try this:

CONCATENATE(""""; B2 ;"""")

@widor provided a nice solution alternative too - integrated with mine:

CONCATENATE(char(34); B2 ;char(34))
like image 181
Jook Avatar answered Sep 09 '25 06:09

Jook


Use CHAR:

=Char(34)&"This is in quotes"&Char(34)

Should evaluate to:

"This is in quotes"
like image 29
Widor Avatar answered Sep 09 '25 05:09

Widor