logo
search
Formatting Issues

How to Create Excel Custom Formats Without Leading Zeros or Decimal Points

Emma BrownEmma Brown Oct 1, 2026 868 views

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.

How to Create Excel Custom Formats Without Leading Zeros or Decimal Points
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Format Cells Dialog

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).

2
Navigate to Custom Formats

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

3
Enter the Format Code

In the 'Type' text box, enter the following code exactly: [=0]0;[<1].####;General

4
Apply the Format

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 for Non-Negative Numbers
Format Breakdown: The code limits decimal places to four using '.####'. You can add more '#' symbols if you need to display additional decimal places.

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. 1. Open Your Workbook: Launch WPS Spreadsheet and open the document containing the numbers you want to format.
  2. 2. Access Format Cells: Select your target cells, right-click, and choose 'Format Cells', or use the Ctrl+1 shortcut.
  3. 3. Apply Custom Syntax: Navigate to the 'Custom' category, input your formatting code (such as [=0]0;[<1].####;General), and click 'OK'.
100% compatible with Microsoft Excel custom formatting syntaxFree and lightweight alternative for powerful spreadsheet managementUser-friendly interface for applying complex cell formats and styles
microsoft office alternative - wps office

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.