Forum Discussion
CHarrison1968
Apr 11, 2023Copper Contributor
Entering 24hr time values
Hi, My user wants to be able to enter 24hr times as "0900", "1245" without any other punctuation and have them convert to (or at least, be interpreted as) valid 24hr times (e.g. 09:00, 12:45). I ...
NikolinoDE
Apr 11, 2023Gold Contributor
If you want to enter and display 24-hour times without any punctuation (e.g., “0900” instead of “09:00”), you can use a custom number format to display the time values in the desired format.
Here’s how you can do it:
- Select the cells where you want to enter and display the time values.
- On the Home tab, in the Number group, click the drop-down arrow next to the Number Format box and select More Number Formats.
- In the Format Cells dialog box, select Custom from the Category list.
- In the Type box, enter “0000” (without the quotes) and click OK.
Now, when you enter a time value in one of the selected cells without any punctuation (e.g., “0900”), it will be displayed as a valid 24-hour time without a colon (e.g., “0900”).
Note that this method only changes how the time values are displayed, not how they are stored internally by Excel. The time values are still stored as decimal numbers representing fractions of a day, so you can use them in calculations and formulas as usual.
Hope this helps!