I have a column for entering military-style times (based on the 24-hour clock) without the colon (or any other separator). And I have Data Validation to ensure my users enter a four-digit number for the time. The cell is formatted Special-"0000". The validation formula is:
=AND(ISNUMBER(E6),LEN(E6)>=3,LEN(E6)<5)
The problem is entering times like 0039 or 0006. Excel automatically ignores the leading zeros in counting digits, and only sees one or two digits, making this an invalid number.
Is there any way to correct the validation formula to account for leading zeros that were actually entered?
Ed
=AND(ISNUMBER(E6),LEN(E6)>=3,LEN(E6)<5)
The problem is entering times like 0039 or 0006. Excel automatically ignores the leading zeros in counting digits, and only sees one or two digits, making this an invalid number.
Is there any way to correct the validation formula to account for leading zeros that were actually entered?
Ed