To put text in an Excel formula, you must enclose the text in double quotation marks (e.g., "Total: ") and use the ampersand symbol (&) to join that text to a cell reference or a mathematical function. For example, the formula ="Total: " & SUM(A1:A10) will display the word "Total: " followed by the calculated sum of those cells.
Combining static text with dynamic data allows you to create labels that update automatically when your numbers change, making your spreadsheets more readable and professional without needing to create separate columns for labels.
What You'll Need
- Microsoft Excel (any version)
- A dataset or a specific cell containing a value you wish to label
Step-by-Step
- Select the Cell: Click on the cell where you want the combined text and formula result to appear.
- Start the Formula: Type the equals sign (
=). This tells Excel that you are entering a calculation rather than plain text. - Enter the Text: Type your desired text inside double quotation marks. For example, if you want the cell to say "The profit is ", type
="The profit is ".
Pro Tip: Include a space before the closing quotation mark so the text doesn't run directly into the number. - Add the Concatenation Operator: Type the ampersand symbol (
&). In Excel, this symbol acts as a "glue" that joins different pieces of data together. - Insert the Reference or Formula:
- To link to a cell, click the cell (e.g.,
B5) or type the cell address. - To link to a calculation, type the function (e.g.,
SUM(B1:B10)).
Your formula should now look like this:="The profit is " & B5. - To link to a cell, click the cell (e.g.,
- Add Closing Text (Optional): If you want text to appear after the value, add another ampersand and another set of quotation marks.
Example:="The profit is " & B5 & " dollars". - Press Enter: Hit the Enter key to execute the formula. The cell will now display the combined text and the value from your reference.
Common Mistakes
- Forgetting Quotation Marks: If you type
=Total: & B5, Excel will return a#NAME?error because it thinks "Total" is a named range or a function rather than a piece of text. - Missing Spaces: Writing
="Total:"&B5results in "Total:100". Always add a space inside the quotes ("Total: ") to ensure the output is readable. - Using a Plus Sign instead of Ampersand: In some software, the plus sign (+) is used for joining text, but in Excel, the plus sign is strictly for mathematical addition. Using it to join text will usually result in a
#VALUE!error. - Mismatched Quotes: Forgetting to close the quotation marks (e.g.,
="Total: & B5) will trigger an Excel alert stating that the formula contains an error.
Tips
- Using the CONCAT Function: While the ampersand (&) is the fastest method, you can also use the
=CONCAT()or=TEXTJOIN()functions for longer strings of text and multiple cell references. - Formatting Numbers: When you combine text with a number, Excel strips the number's formatting (like currency symbols or decimal places). To keep the formatting, use the TEXT function.
Example:="Total: " & TEXT(B5, "$#,##0.00"). - Adding Line Breaks: To put text on a new line within the same cell, use
CHAR(10).
Example:="Summary:" & CHAR(10) & B5. (Note: You must enable "Wrap Text" in the Home tab for the line break to appear).
Troubleshooting
If your formula is not working as expected, try these steps in order:
- Check for #NAME? Error: This almost always means a missing quotation mark around your text. Ensure every word is wrapped in
" ". - Check for #VALUE! Error: Ensure you used the
&symbol to join the text and the cell, not a+sign. - Verify Cell Formatting: If the cell shows the actual formula (e.g.,
="Total: " & B5) instead of the result, the cell is likely formatted as "Text". Change the cell format to "General" via the Home tab, then double-click the cell and press Enter again. - Check for Circular References: Ensure the formula is not placed in the same cell it is referencing (e.g., putting the formula in cell B5 while the formula references B5). This will cause a circular reference error.
Frequently Asked Questions
Can I put a date in a text formula?
Yes, but you must use the TEXT function to prevent the date from appearing as a raw number. Use ="Today is " & TEXT(A1, "mm/dd/yyyy").
How do I include a double quote inside my text?
To display a quotation mark within your text, you must use double-double quotes. For example, ="He said ""Hello"" to me" will display as: He said "Hello" to me.
Is there a limit to how much text I can put in a formula?
Excel allows a very large number of characters in a formula (up to 8,192), but for extremely long paragraphs, it is better to put the text in a separate cell and reference that cell in your formula.
Does this work in Google Sheets as well?
Yes, the syntax for combining text using quotation marks and the ampersand (&) is identical in both Microsoft Excel and Google Sheets.
Can I use this to create a dynamic header?
Yes. By referencing a cell that contains a date or a project name, you can create a header like ="Sales Report for " & A1 that updates automatically whenever you change the value in A1.