How to Format Numbers with Dots and Dashes in Excel
Question details
The user needs to display an eight-digit number with specific dots and a dash (e.g., 1.222-333.4), requiring periods to act as literal text characters instead of decimal separators.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying a specific visual display format to raw numeric data for structured IDs, part numbers, or specialized codes.
- Observed behavior
- To display the numbers as 1.222-333.4, the periods must be escaped in the custom format settings, ensuring the underlying value remains a pure eight-digit integer.
Ensure your target cells contain only raw numeric values (such as 12223334) without any existing manual text characters or punctuation.
Use Custom Number Format with Escaped Periods
Apply a custom formatting code using backslashes to force Excel to treat periods as literal text characters instead of decimal points.
In Excel, the period is natively recognized as a decimal point. To use it merely for visual separation in a number sequence, you must place a backslash (\) before it in your custom format code.
Highlight the cell or range of cells containing the eight-digit numbers you want to format.
Right-click the selected cells and choose "Format Cells" from the context menu, or simply press the Ctrl + 1 keyboard shortcut.
In the Format Cells window, navigate to the "Number" tab and select "Custom" from the Category list on the left side.
In the "Type" input box, type exactly #\.###-###\.# and click "OK" to apply the new formatting.

Apply Custom Number Formats Easily in WPS Spreadsheet
WPS Office offers robust and fully compatible spreadsheet capabilities. You can easily apply the exact same custom number formatting tricks with dots, dashes, and escape characters seamlessly for free.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the unformatted numbers.
- 2. Select and Right-Click: Highlight the target cells, right-click to open the context menu, and select "Format Cells" (or press Ctrl+1).
- 3. Apply Custom Format: Navigate to the Custom category, enter the format code #\.###-###\.# in the Type field, and click OK.

Frequently Asked Questions
Why do I need a backslash before the period in my custom format?
Spreadsheet applications recognize the period as a decimal separator by default. Placing a backslash before the period (\.) acts as an "escape" character, telling the software to display a literal dot instead of interpreting it mathematically.
Does custom formatting change the actual value in the cell?
No. Custom number formats only alter the visual display of the cell's contents. The underlying raw data remains unchanged and can still be used accurately in mathematical calculations or data lookups.
How can I remove a custom number format applied to my cells?
To revert your data to its original state, select the formatted cells, press Ctrl + 1 to open the Format Cells dialog, and select "General" from the Category list. Click OK to remove the custom display rules.
Can I use this method to format other types of codes like Social Security or phone numbers?
Yes. Custom formats are highly versatile. You can use dashes, parentheses, or spaces directly in the Type field (e.g., 000-00-0000 for an SSN) to display strings of numbers in standard readable formats while keeping the underlying data purely numeric.




