Let me know if Iām getting this right: Youāre working on a spreadsheet in Google Sheets. The cells youāre working on have a formula that outputs text. You want to add quotes to the text, but it keeps breaking the formula.
So you did what anyone else would do in your situation: You googled the matter and landed on this page. Welcome, and read on! Weāll show you how to do it.
How to Add Quotes to a Google Sheets Formula
Suppose you have the following Google Sheets formula:
="John said, Hello, everybody."
You canāt put quotes inside quotes, as youāve already found out, because itāll break the formula.
But if you replace the quotes with CHAR(34)
ā the character code for straight double quotes ā the formula will convert it to quotes at the output.
="John said, CHAR(34)Hello, everybody.CHAR(34)"
The trick is to put CHAR(34) exactly where you want the quotes to appear, without extra space before or after.
Google Sheets Character Codes for Quotes
Quotes can be single or double, straight or curly. Depending on the type of quotes you need to insert in your formula, use the codes below:
Name | Character | Code |
---|---|---|
Double quotes, straight | " | CHAR(34) |
Single quote, straight | ' | CHAR(39) |
Double quotes, curly, opening | ā | CHAR(8220) |
Double quotes, curly, closing | ā | CHAR(8221) |
Single quote, curly, opening | ā | CHAR(8216) |
Single quote, curly, closing | ā | CHAR(8217) |
In Summary
To add quotes to the text outputted by a formula in Google Sheets, use the CODE()
function. Now, you know how, and which values to use!