totn Excel Functions

MS Excel: How to insert a Double Quote in Formula

This Excel tutorial explains how to put double quotes in a text formula in Excel.

Placing a double quote inside of a formula in Excel might seem a bit tricky. Normally, when you write a formula in Excel, you enclose any string values in double quotes. So it might not seem obvious how you can put a double quote in your formula without Excel returning formula errors.

Let's start by looking at a formula that uses double quotes to separate string values in the formula. This will help you better understand the challenge of how to use double quotes in an Excel formula.

For example:

Microsoft Excel

In this example, we have a formula in cell C4 that uses double quotes to enclose string values as follows:

=A4 & " feet is equal to 24 inches exactly"

This formula would output the following text value:

2 feet is equal to 24 inches exactly

Now, how could we replace the word inches in this example with a double quote so that the double quote is displayed in the formula result?

There are 2 ways that we can insert a double quote in a formula. The first method is to escape the double quote and the second method is to use the CHAR function. Let's explore both of these options.

Escape the Double Quote

Inserting a double quote is actually quite easy to do. If you escape your double quote with an additional double quote, Excel will treat the escaped double quote as a literal value instead of treating the double quote as the start or end of a string value.

For example:

Microsoft Excel

Here, we have changed our formula in cell C4 to insert one double quote by entering two double quotes in the formula:

=A4 & " feet is equal to 24"" exactly"

This formula would output the following text value:

2 feet is equal to 24" exactly

By placing two double quotes, Excel knows that we are escaping the second double quote. Now our formula will display a double quote in the formula results. The double quote is now treated as a literal.

Use the CHAR function

You can also insert a double quote in an Excel formula using the CHAR function.

The CHAR function takes the ASCII value and returns the corresponding character value. The ASCII value for a double quote is 34. Let's show you show we could modify our example above and use the CHAR function with an ASCII value of 34 to insert the double quote in our formula.

For example:

Microsoft Excel

Here, we have changed our formula in cell C4 to insert a double quote by using the CHAR function in the formula:

=A4 & " feet is equal to 24" & CHAR(34) & " exactly"

This formula would output the following text value:

2 feet is equal to 24" exactly

Now when the formula encounters the CHAR(34), it returns a double quote value.

As you can see, there are different ways to insert a double quote within a formula in Excel. It is up to you to choose which method you prefer.