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!