Formatting Issues

How to Show Optional Decimal Places and Add Text Labels in Excel

Steve KSteve K Oct 26, 2026 871 views

Question details

The user wants to format cells to display whole numbers without trailing zeros, show decimal places only when they exist, and automatically append a specific text label (e.g., "in").

How to Show Optional Decimal Places and Add Text Labels in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Formatting numerical data with specific measurement units for better readability, while keeping the visual layout clean by omitting unnecessary decimal zeros on whole numbers.
Observed behavior
The user needs numerical values to dynamically display as whole numbers with a label (e.g., "48 in") and fractional numbers with a label (e.g., "48.7 in") while maintaining their underlying numerical value.
Before you start

Ensure you have selected the correct range of cells containing the numbers you want to format before opening the formatting dialog.

Solution 1Recommended

Apply a Custom Number Format Using 'General'

Use the Format Cells dialog to apply a custom format string that automatically adjusts decimal places and appends your desired text unit.

The 'General' number format in Excel dynamically displays decimal places only when they actually exist, successfully avoiding trailing zeros for whole numbers. By appending your desired text enclosed in quotation marks to the 'General' rule, you can create a custom unit label.

1
Select the target cells

Highlight the cells or range containing the numbers you want to format with custom text labels.

2
Open the Format Cells dialog

Right-click the selected cells and choose 'Format Cells' from the context menu, or press the 'Ctrl + 1' shortcut on your keyboard.

3
Navigate to Custom formats

In the Format Cells window, go to the 'Number' tab and select 'Custom' from the Category list on the left side.

4
Enter the custom format string

In the 'Type' input field, enter the string: General "in" (replace "in" with your preferred unit, ensuring you keep the space before it inside the quotes if you want spacing). Click 'OK' to apply.

Apply a Custom Number Format Using 'General'
Calculations Remain Intact: Applying a custom format changes only the visual display of the cell. The underlying value remains a pure number, meaning you can still use these formatted cells in mathematical formulas like SUM or AVERAGE.
Professional Spreadsheet Editor

Format Custom Number Labels Easily with WPS Spreadsheet

WPS Spreadsheet offers full support for custom number formatting, allowing you to add text labels and manage decimal places exactly like Microsoft Excel. It provides a familiar interface to organize and format your data efficiently.

  1. 1. Select Cells in WPS: Open your spreadsheet in WPS Office and highlight the cells you want to format.
  2. 2. Access Format Cells: Right-click the selection and click 'Format Cells', or press Ctrl + 1.
  3. 3. Apply Custom Format: Navigate to 'Custom' under the 'Number' tab, type General "in" in the Type box, and click OK.
Full support for Excel custom number formatting rules like 'General'.Highly compatible with Microsoft Excel (.xlsx and .xls) file formats.Free, lightweight, and fast to load large datasets without lagging.Familiar user interface for seamless and quick migration.
microsoft office alternative - wps office

Frequently Asked Questions

How do I add different text labels for positive and negative numbers?

You can use semicolons to separate format conditions for positive, negative, zero, and text values. For example, entering `General "profit";-General "loss"` in the custom format type box will append different labels based on the number's mathematical sign.

Why are my whole numbers showing trailing zeros after formatting?

If your whole numbers display unnecessary zeros (e.g., 48.00 in), you likely applied a fixed decimal format like `0.00 "in"`. Change your custom format type to `General "in"` to hide unnecessary trailing zeros.

Can I sort or sum the numbers after adding text labels this way?

Yes. Because custom number formatting only changes the visual presentation and does not convert the actual cell value to text, you can continue to sort, filter, and use mathematical functions like SUM normally.