How to Create Excel Custom Formats Without Leading Zeros or Decimal Points
Question details
The user wants to format numbers in Excel to display decimal values without a leading zero while ensuring whole numbers do not show a trailing decimal point.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying specific numeric formatting to cells containing positive, negative, or zero values to achieve a customized and clean display.
- Observed behavior
- Excel's custom format limits users to three condition sections, making it challenging to simultaneously remove leading zeros for decimals, hide decimal points for integers, and perfectly format zero or negative numbers in a single rule.
Select the cells you want to format and check whether your dataset includes negative numbers or exact zeros, as Excel's custom format rules are limited to three conditional sections.
Apply Custom Format for Non-Negative Numbers
Use this custom format string if your dataset consists purely of positive values and zeros.
This solution works best for non-negative datasets. It correctly displays '0' for exact zeros, drops the leading zero for decimals under 1, and uses standard formatting for numbers 1 and above.
Select the range of cells you wish to format, right-click, and choose 'Format Cells' from the context menu (or press Ctrl+1 on your keyboard).
In the Format Cells window, go to the 'Number' tab and select 'Custom' from the Category list on the left.
In the 'Type' text box, enter the following code exactly: [=0]0;[<1].####;General
Click 'OK' to apply the formatting. Values like 0.5 will now display as .5, while whole numbers will display normally without a decimal point.

Apply Custom Format to Include Negative Decimals
Use this alternative format if your dataset includes negative decimals, keeping in mind the limitation regarding exact zeros.
Format Numbers Easily with WPS Spreadsheet
WPS Spreadsheet provides robust, built-in support for custom number formats. You can seamlessly apply advanced conditional formatting rules to your data just like in Microsoft Excel.
- 1. Open Your Workbook: Launch WPS Spreadsheet and open the document containing the numbers you want to format.
- 2. Access Format Cells: Select your target cells, right-click, and choose 'Format Cells', or use the Ctrl+1 shortcut.
- 3. Apply Custom Syntax: Navigate to the 'Custom' category, input your formatting code (such as [=0]0;[<1].####;General), and click 'OK'.

Frequently Asked Questions
Why can't I format positive, negative, and zero values perfectly in one custom format string?
Excel and WPS Spreadsheet custom number formats support a maximum of three conditional sections for numbers, separated by semicolons (the fourth is reserved for text). If you use two sections for specific mathematical conditions like [<1] and [>=1], you will not have a dedicated section left for handling exact zeros or negative values, resulting in compromised display formatting for the excluded condition.
How many decimal places can Excel custom formats display?
Spreadsheet software like Excel calculates and displays numeric precision up to a maximum of 15 significant digits. If you use a custom format with more than 15 placeholders (e.g., '.###############'), it will not increase the underlying precision or reveal more accurate data beyond that limit.
What does the 'General' format do in a custom format string?
The 'General' format instructs the application to display the number exactly as it was typed or calculated, without forcing extra trailing zeros or decimal points. It serves as an excellent fallback format for whole numbers in your custom formatting rules to ensure they remain clean.




