We work on a 24-hour clock system. We input times as a four-digit number as hhmm (no colon). To help and remind users that this needed to be a complete four-digit time, I formatted the cell with Custom >> 0000, and used the following Data Validation:
Allow: Custom
Formula:
This works okay for times after 0100. But with times from 0001 - 0059, I get my error message:
Apparently, the Validation is looking at the number without applying the leading zeros to the LEN. The Validation sees only the one or two digits following the leading zeros, says it's too short, and will not allow the input.
Any suggestions to correct this issue?
Ed
Allow: Custom
Formula:
Excel Formula:
=AND(ISNUMBER(E31),LEN(E31)>=3,LEN(E31)<5)
This works okay for times after 0100. But with times from 0001 - 0059, I get my error message:
Rich (BB code):
Time values must be four digits, including any leading zeros.
Apparently, the Validation is looking at the number without applying the leading zeros to the LEN. The Validation sees only the one or two digits following the leading zeros, says it's too short, and will not allow the input.
Any suggestions to correct this issue?
Ed