How to Count Decimal Digits in an Excel Value
Question details
Count the digits after the decimal separator in an Excel value and return zero when there is no decimal portion.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to count decimal digits in a cell containing either text or a numeric value.
- Observed behavior
- An integer such as 15 should return 0, while a value with decimal digits should return the count after its decimal separator.
Check whether B3 contains text or a number, and identify the decimal separator used in the value. The examples below use a period and commas between formula arguments; adjust them for your regional settings if needed.
Count decimal digits in a text value
Use this formula when B3 is stored as text and trailing zeros should be counted.
Select an empty cell and enter =IFERROR(LEN(B3)-FIND(".",B3),0).
Press Enter. Text values 15, 15.2, and 15.00 return 0, 1, and 2 respectively.

Count significant decimal digits in a numeric value
Use this approach for a number when displayed trailing zeros are not significant.
Count decimal digits with WPS Spreadsheets
Use LEN, FIND, and IFERROR in WPS Spreadsheets to count characters after the decimal separator in a text value, including trailing zeros.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Check the source value: Select B3 and check that it contains a text value using a period as the decimal separator.
- 3. Enter the formula: Select an empty cell and enter =IFERROR(LEN(B3)-FIND(".",B3),0).
- 4. Verify the result: Press Enter and check that 15 returns 0 and text such as 15.00 returns 2.

Frequently Asked Questions
Why should 15 return zero decimal digits?
The integer 15 has no decimal portion. The formulas use IFERROR to return 0 when FIND does not locate a decimal separator.
How can I count trailing zeros after the decimal point?
Store the value as text and use =IFERROR(LEN(B3)-FIND(".",B3),0). For example, the text 15.00 returns 2.
Why does a numeric cell displayed as 15.00 return zero?
The two zeros can come from the cell's number format rather than the stored numeric value. The numeric formula counts significant decimal digits, not formatting.
What if my values use a comma as the decimal separator?
For text values, replace the period inside FIND with a comma. For numeric values, also check that the TEXT format matches your regional settings; formula argument separators may need adjustment too.




