Richard H
Richard H

Reputation: 39085

How to quote a quote with the CONCATENATE function in OOCalc

In OOCalc I want to use the CONCATENATE function to add quotes to each string in column A.

So in cell B1 I want to do:

=CONCATENATE("\"",A1,"\"")

OOCalc does not like this, or without the escaping backslash.

Does anyone know how to do this, or what an alternative method might be?

Upvotes: 119

Views: 150925

Answers (5)

Kiran
Kiran

Reputation: 548

Use char(34) to get the quote character.

CONCATENATE(char(34); B2; char(34))

Upvotes: 44

Alexis
Alexis

Reputation: 842

You can do it in 2 ways,

  1. By using =CHAR(34) in the places of doible quotes eg: =CONCATENATE("coffee",CHAR(34),"code")

  2. By concatenating cell values

Steps

  • Set the cell value as double quotes -> "
  • Concatenate that cell in the string, wherever you need double quotes. eg: E1 = " F1 = =concatenate("coffee",E1,"code")

Thank you

Upvotes: 3

Steven
Steven

Reputation: 820

You can use single quotations marks within the double quotation marks and vice versa.

Upvotes: 0

Jake Toronto
Jake Toronto

Reputation: 3584

Identical to the above but without the function:

="""" & A1 & """"

Upvotes: 16

Andy Balaam
Andy Balaam

Reputation: 6671

This works for me:

=CONCATENATE("""",A1,"""")

Repeating the quotes escapes them (as it does in Visual Basic, I believe), so """" reads as: 'one quote to start a string, one escaped quote (""), then one quote to finish the string'.

Upvotes: 191

Related Questions