How to Display a Text Label While Keeping Numeric Values in Excel
Question details
The user wants to display a text prefix or label within a cell without changing the cell's underlying numeric value so it can still be used in calculations.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Formatting spreadsheet cells to visually include descriptive text (like 'x=1') while ensuring mathematical formulas continue to work.
- Observed behavior
- The user needs the cell to visually output text alongside a number, but act as a standard number when referenced by other cells.
Ensure the cells you want to format currently contain only numeric values. If you have already typed text into the cell manually, Excel will treat it as a text string, and custom number formatting will not work.
Use Custom Number Formatting to Add a Text Label
By applying a custom number format, you can visually add a text prefix or suffix to a cell while preserving its underlying numerical value for calculations.
Custom number formatting is a powerful feature that changes how data is displayed without altering the actual data stored in the cell. Any text you enclose in double quotes within the format code will be displayed alongside your numbers.
Click and drag to highlight the cells where you want the text label to appear alongside the numeric value.
Press the keyboard shortcut Ctrl+1, or right-click on the selected cells and choose 'Format Cells' from the context menu.
In the Format Cells window, go to the 'Number' tab and click on 'Custom' at the bottom of the Category list on the left side.
In the 'Type' input field, enter your text enclosed in double quotation marks followed by a number format code. For example, type "x="0 for whole numbers or "x="General to display arbitrary decimal values.
Click the OK button. The cells will now display your text prefix (e.g., x=1), but if you look at the formula bar, the original number is retained.

Format Numbers with Custom Text Labels in WPS Spreadsheet
WPS Spreadsheet provides advanced cell formatting capabilities, allowing you to seamlessly add text labels to numbers without breaking your formulas. It operates exactly like Microsoft Excel, making the transition effortless.
- 1. Open Your Spreadsheet: Launch WPS Office and open your workbook using WPS Spreadsheet.
- 2. Access Cell Formatting: Select the cells you want to modify, right-click them, and select 'Format Cells' from the menu.
- 3. Apply a Custom Format: Under the 'Number' tab, select 'Custom'. Type your text prefix in double quotes followed by your preferred number format (e.g., "Total: "0.00).
- 4. Save and Calculate: Click OK to apply the format. Your data is now visually labeled and fully functional for calculations.

Frequently Asked Questions
Can I add a text suffix instead of a prefix?
Yes. To add a suffix, place the text in double quotes after the number format code. For example, typing 0" units" in the custom format field will display a number like '5 units'.
Why are my formulas returning #VALUE! errors after adding text?
This happens if you manually type the text and the number together into the cell, which causes Excel to treat the entry as text. You must enter only the number in the cell and use the Format Cells dialog to visually apply the text label.
How do I remove the custom text label and revert to normal numbers?
Select the formatted cells, press Ctrl+1 to open the Format Cells dialog, and change the category from 'Custom' back to 'General' or 'Number'.
Can I format dates with text labels using this method?
Yes, you can combine text strings with date formatting codes. For example, entering "Due Date: "mm/dd/yyyy in the custom format field will display the text alongside a valid, calculable date.




