logo
search
Formatting Issues

How to Format Numbers with Dots and Dashes in Excel

Muhammad TalhaMuhammad Talha Oct 8, 2026 869 views

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.

How to Format Numbers with Dots and Dashes in Excel
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.
Before you start

Ensure your target cells contain only raw numeric values (such as 12223334) without any existing manual text characters or punctuation.

Solution 1Recommended

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.

1
Select the target cells

Highlight the cell or range of cells containing the eight-digit numbers you want to format.

2
Open the Format Cells dialog

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

3
Choose the Custom category

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

4
Enter the custom format code

In the "Type" input box, type exactly #\.###-###\.# and click "OK" to apply the new formatting.

Use Custom Number Format with Escaped Periods
Data Integrity Preserved: This method only changes how the data looks on your screen. The actual underlying value remains a pure number (12223334), allowing you to continue using it in formulas and calculations.
Free Spreadsheet Software

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. 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the unformatted numbers.
  2. 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. 3. Apply Custom Format: Navigate to the Custom category, enter the format code #\.###-###\.# in the Type field, and click OK.
100% compatible with Microsoft Excel (.xlsx and .xls) file formatsFree and lightweight office suite for everyday spreadsheet tasksFamiliar user interface for quick adoption without a learning curveRich support for advanced custom formatting rules
microsoft office alternative - wps office

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.