Count a Three-Digit Range Such as 001-999 in Excel
Question details
Determine how many endpoints or integers are represented by a range such as 001-999 in Excel.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to count a three-digit range without interpreting its hyphen as subtraction.
- Observed behavior
- The desired result is either two endpoints or 999 integers in the inclusive range, depending on what is being counted.
Decide whether you want to count the two endpoints or every integer in the inclusive range. For a range in one cell, format the cell as Text before entering 001-999, or type an apostrophe first: '001-999.
Count all integers in a text range
Use this formula when A1 contains a hyphen-separated range and you need the inclusive count.
The formula assumes one hyphen separates two nonnegative integers and the lower endpoint comes first.
In cell A1, enter '001-999. The apostrophe tells Excel to store the value as text and is not displayed in the cell.
In another cell, enter =VALUE(MID(A1,FIND("-",A1)+1,LEN(A1)))-VALUE(LEFT(A1,FIND("-",A1)-1))+1 and press Enter.
For 001-999, the formula returns 999 because it includes both 1 and 999.

Count the endpoints with TEXTSPLIT
Use this method when you only need to count the two parts of a text range and your Excel version supports TEXTSPLIT.
Count an inclusive range from separate numeric cells
Use this method when the lower and upper endpoints are already stored as numbers in separate cells.
Count a Three-Digit Range in WPS Spreadsheets
Use WPS Spreadsheets to store a hyphenated range as text, extract its endpoints, and calculate the inclusive count.
- 1. Open a spreadsheet: Launch WPS Office and open a workbook in Spreadsheets.
- 2. Enter the range: In cell A1, type '001-999 to store the range as text.
- 3. Enter the count formula: In another cell, enter =VALUE(MID(A1,FIND("-",A1)+1,LEN(A1)))-VALUE(LEFT(A1,FIND("-",A1)-1))+1 and press Enter.
- 4. Verify the count: Check that the formula returns 999 for the inclusive range 001-999.

Frequently Asked Questions
Does 001-999 represent 2 values or 999 values?
It has two endpoints, but it represents 999 integers when counting every integer from 1 through 999, inclusive.
How do I keep Excel from treating the hyphen as subtraction?
Enter the range as text by typing '001-999 in the cell, or format the cell as Text before entering 001-999. Do not start the entry with an equals sign.
Why does the inclusive count formula add 1?
Subtracting the lower endpoint from the upper endpoint counts the gaps between them. Adding 1 includes both endpoints, so 999-1+1 returns 999.
How can I show leading zeros when the endpoints are in separate cells?
Select the endpoint cells, open Format Cells, and apply the custom number format 000. The cells remain numeric while displaying values such as 001.




