To show a formula result in an Excel text box, enter the calculation in a worksheet cell, select the text box border, type a reference to that cell in the formula bar, and press Enter. The box will display the cell’s result and update when the result changes. Excel text boxes do not work like worksheet cells: put the calculation in a cell, then link the box to it.
What You’ll Need
- A workbook open in Microsoft Excel for Microsoft 365 on Windows. The desktop Mac app has a similar workflow; notes for Mac and Excel for the web are included below.
- A worksheet cell for the formula result, plus the data that formula needs.
- A text box in the workbook. If you have not made one yet, you can insert it during the steps below.
Step-by-Step
- Choose a cell to hold the result. Decide which cell will calculate the value or build the text you want to show. Keeping the calculation in a worksheet cell makes it easier to inspect, edit, and reuse. You can place the helper cell away from the main report, or on a separate worksheet, but do not delete it while the text box depends on it.
- Enter and check the calculation. For example, suppose the sales amounts are in B2:B6, with values 120, 85, 95, 110, and 90. Enter this in a free cell such as C2:
=SUM(B2:B6)
The assumed layout is sales amounts in B2:B6. The result in C2 is 500, because 120 + 85 + 95 + 110 + 90 = 500. Check that the cell shows the intended answer before linking the text box; if the cell itself is wrong, the box will repeat that wrong result. - Insert a text box if needed. On Windows, select Insert > Text > Text Box, then drag on the worksheet to draw the box. The exact grouping can vary with ribbon width, so look for Text Box on the Insert tab if the Text group is collapsed. On Excel for Mac, use the Insert tab and choose Text Box, then drag to draw it. If a box already exists, skip this step.
- Select the box as an object. Click its outer border, not inside the box where a text cursor appears. The border or sizing handles should show that the whole object is selected. This matters: typing while the insertion cursor is inside the box adds ordinary text, rather than creating a link.
- Use the formula bar to link to the result cell. Click the formula bar above the worksheet grid, type
=C2, and press Enter. This example assumes the result is in C2 on the same worksheet. The formula bar reference connects the selected text box to that cell; it does not put a new calculation inside the box. If the formula bar is not visible, turn it on from View > Formula Bar. - Confirm that the link worked. The text box should now display 500, the value from C2. Click the cell and change one of the sample sales amounts to check that the box follows the updated result. Restore the original value if you are using the example data in a report.
- Link to another worksheet if your result is elsewhere. Select the box border, click the formula bar, and enter a reference to the result cell on the other sheet. If the result is in C2 on a sheet named Summary, use
=Summary!$C$2. If the sheet name contains spaces, enclose it in single quotation marks, as in='Monthly Sales'!$C$2. These examples assume the result is in C2 of the named sheet. The dollar signs keep the referenced row and column fixed if you later copy the object or change the reference. - Format the displayed result. Drag the text box handles to adjust its size, then use the Home tab or the contextual Shape Format tab to set the font, size, alignment, fill, and outline. A linked box can show a numeric result, but when you need exact wording, currency symbols, or a custom date format, build the complete display string in a worksheet cell and link the box to that cell instead.
For a label and a total together, assume sales amounts are in B2:B6 and C2 is available for the display text. Enter this formula in C2: ="Sales total: "&TEXT(SUM(B2:B6),"#,##0"). It returns Sales total: 500 for the example amounts above. Then select the text box border and link it to C2 with =C2. The box shows the whole phrase and refreshes when the amounts change. The TEXT function’s format code controls how the number appears; for example, you could use a currency format if that suits your workbook and regional settings.
On Excel for Mac, the basic process is the same: create or select the text box, select its border, enter the cell reference in the formula bar, and press Return. If the box is in text-edit mode, press Esc first and click its border. Excel for the web has more limited support for working with drawing objects, and available commands can vary. If you cannot create or link the box in your browser, open the workbook in the desktop Excel app.
Common Mistakes
- Typing the calculation into the box itself. The box’s text-edit mode is for display text, not worksheet calculations. Enter the formula in a cell, then link the text box to that cell.
- Entering the link while editing the text. If a blinking cursor is inside the box, Excel may treat your entry as literal text. Press Esc, select the outer border, and use the formula bar.
- Forgetting the equals sign. A cell reference entered in the formula bar must begin with
=. Without it, Excel may treat the entry as text rather than a link. - Using the wrong sheet name or cell. A misspelled sheet name, missing apostrophe around a name with spaces, or incorrect address can prevent the reference from working. Check the exact tab name and destination cell.
- Expecting formatting to carry over exactly. If the linked result appears as a long decimal, an unformatted date, or a plain number, format the source cell or create a formatted text string with TEXT in a helper cell. Then link the box to that helper cell.
- Deleting or moving the source cell without checking the link. The text box depends on its referenced cell. Moving, clearing, or deleting that cell can change the displayed result or break the link.
Tips
- Keep helper cells understandable. Put a label next to the result, such as “Text box output,” or use a clearly named worksheet. You can hide a helper column if appropriate, but keep the linked cell in the workbook and document its purpose.
- Use a display formula for mixed text and numbers. A formula cell can combine a short label with a calculated value, as in the example above. This is often more dependable than trying to format several separate elements inside the text box.
- Make the box large enough for changing results. A longer label, larger number, or different font can cause text to be clipped. Leave some extra width and height, then test the box with a longer realistic result.
- Check calculation settings if updates seem delayed. With automatic calculation enabled, formula results normally recalculate as inputs change. If the workbook is set to manual calculation, use Formulas > Calculate Now or press F9 on Windows. On Mac, the calculation shortcut can depend on keyboard settings; use the Formulas tab if the key does not work.
- Use a clear visual style. Keep the text box readable against the worksheet background, and avoid making the box look like an input cell if readers are only meant to view its result. A concise label can make a dashboard value easier to interpret.
Troubleshooting
The box shows the characters =C2 instead of the cell value. The object was probably in text-edit mode, or the entry was typed into the box rather than its formula bar. Press Esc, click the box’s outside border, click the formula bar, enter the reference again with its leading equals sign, and press Enter.
The box does not change when the source value changes. Confirm that the box is linked to the cell you are editing, not a nearby cell or an old result cell. Check that the source formula recalculates and that calculation mode is automatic under Formulas > Calculation Options. If the workbook uses manual calculation, recalculate it. Also confirm that the box has not been replaced with a separate, unlinked text box.
The box is blank or shows an error. Inspect the linked cell first. A blank source cell produces no useful display, while an error in the source formula can appear in the box too. Fix the underlying cell formula or its inputs, then check the sheet reference and cell address in the formula bar. For a sheet name containing spaces, use single quotation marks around the name.
The result is cut off or looks incorrectly formatted. Enlarge the box and check its font size and alignment. If the value needs a particular format, create that formatted output in a helper cell with TEXT, then link the box to the helper. Test with the largest likely value, not just the current one.
You cannot select the box or find the command. Click the border rather than the text, or press Esc to leave text-edit mode. If the object is behind another shape, use Home > Find & Select > Selection Pane to locate and select it. In Excel for the web, open the file in desktop Excel if the needed text-box controls are unavailable.
Frequently Asked Questions
Can I put a formula directly inside an Excel text box?
Not as a normal worksheet calculation. Put the formula in a cell and link the box to that cell through the formula bar. You can type fixed wording directly in a text box, but it will not calculate like a cell formula.
Will the text box update automatically?
Yes, when it is linked to a cell, the box reflects that cell’s current result. The source formula must recalculate; manual calculation settings can delay the update until you recalculate the workbook.
Can the text box show words and a formula result together?
Yes. Combine the label and calculated value in a helper cell, then link the box to that cell. The TEXT function can control how a number is displayed within the combined text.
Can I link a text box to a cell on another worksheet?
Yes. Select the box border and enter a sheet-and-cell reference in the formula bar. For sheet names with spaces, put the name in single quotation marks before the exclamation mark.
Does this work in Excel for Mac or Excel for the web?
The desktop Mac app uses a similar text-box and formula-bar workflow, though ribbon placement and keyboard shortcuts can differ. Excel for the web has more limited drawing-object support; use desktop Excel if the required text-box controls are missing.
Related
- How to Make a Copy of a Sheet in Excel
- Freeze Panes in Excel: Keep Rows and Columns Visible
- Find Duplicates in Excel: A Practical Step-by-Step Guide
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- XLOOKUP Excel Cell References: A Practical GuideIn Excel, an XLOOKUP cell reference is the cell or range you tell the function to search or…
- Excel MONTH Function Examples: Formulas and TipsExcel’s MONTH function extracts the month number from a date, returning an integer from 1 (January) to 12…
- Power BI XLOOKUP: DAX and Power Query Lookup OptionsPower BI does not have Excel’s XLOOKUP function in DAX. To match a value from another table, use…
- COUNTIF in Excel: Count Cells That Contain NumbersYes—COUNTIF can count cells that meet a numeric condition, and it can find text containing a particular digit.…
- Excel MEDIAN Function Examples and How It WorksTo find the middle value in Excel, use the MEDIAN function: with your numbers in B2:B8, enter =MEDIAN(B2:B8).…
- Filter Excel Table by Text: Steps, Options, and FixesTo filter an Excel table by text in Microsoft 365 for Windows, select the drop-down arrow in the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.