5

In libreoffice calc I have a column with thousand words. Each word I need to put into quotation marks.

Example (A1 and A2 are cells)

start word (A1): car
end word (A2): "car"

Normally, I can reference cells and add new text with quotes.

Example

= A1 & " wash" A2: car wash

But how do I get quotation marks as part of the text? Example

"car" wash

NewbieXXL
  • 155
  • 1
  • 1
  • 11

2 Answers2

13

One way to add quotes: use the CHAR() function together with the correct decimal ASCII code. CHAR(34) should return double quotes. You can insert the CHAR() function directly into a concat statement:

= CHAR(34) & A1 & CHAR(34) & " wash"

should combine the content of A1, nested into double quotes, and append " wash".

To modify the source data itself (in your example: no second column, modify the source column), you could use a search / replace with regular expressions. To do so:

  1. Select the column containing the data to modify
  2. select Menu "Edit" -> "Find & Replace..."
  3. Enter ^(.*)$ as search text (matches the whole cell content) and "$1" as replace text (returns the complete search match, embedded in quotes): enter image description here
  4. Hit Replace or Replace all to execute the search/replace run.
tohuwawohu
  • 13,268
  • 4
  • 42
  • 61
  • I know this will be deleted but I love you. You saved me a shlt tonne of time and tedium. – Rich Jan 11 '22 at 10:27
0

It also works with CONCAT and escaping the quote sign:

=CONCAT("""", A1, """ wash")

To escape ", put another " in front of it, so "" results in one double quote ". Putting this in a string results in """"" for one double quote.

Using double quotation marks in formulas

sebix
  • 2,943
  • 2
  • 28
  • 43