Please Note:
This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Using an Input Mask.

Using an Input Mask

When inputting time into a cell, it is easy to enter digits—that's what the numeric keypad is for, after all. What can really slow you down is the necessity to enter other characters, particularly ones that require the use of the Shift key. For instance, if you are entering times, it is easy to enter 230 for 2:30, but it is a pain to slow down by entering the colon.

Thus, you may wonder if there is a way to set up an input mask that will add the colon automatically. The good news is yes, there is. The bad news is no, there isn't. Sound confusing? Let me explain...

You can set up a custom format that will display your time in any format you want. For instance, you could use the following steps:

Replace whatever is in the Type box with #":"00 (a pound sign, quote mark, colon, quote mark, and two zeros).

Click on OK.

You can now enter your times using just digits. The problem (and this is the bad news) is that the cell doesn't really contain a time. If you enter 230 (for 2:30), it doesn't contain 2:30 as a time—it contains two hundred and thirty. Thus, you can't use the contents of the cell directly in time calculations.

To overcome this, you can use another column to show the entered digits converted into a time. All you need to do is use a formula to do the conversions. For instance, if the time you entered was in cell A3, you could use the following formula in a different cell to do the conversion:

=(INT(A3/100)/24)+((A3 - (INT(A3/100)*100))/1440)

Format the cell that contains the above formula so it displays one of the various time formats, and you are all set.

ExcelTips is your source for cost-effective Microsoft Excel training.
This tip (2746) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Using an Input Mask.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. Learn more about Allen...

MORE FROM ALLEN

Segregating Numbers According to Their Sign

Remember your number line from your early years in school? Some numbers can be below zero (negative numbers) and others ...

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Understanding Names

Excel provides the ability to define names that refer to cells or ranges of cells. These can then be used in your ...

Comments

If you would like to add an image to
your comment (not an avatar, but an image to help in making the point of your comment),
include the characters [{fig}] in your comment text. You’ll be prompted to upload
your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will
be reduced. Up to three images may be included in a comment. All images are subject to
review. Commenting privileges may be curtailed if inappropriate images are posted.

Source

(gif, jpeg or png only, 5MB maximum file size)

Source

(gif, jpeg or png only, 5MB maximum file size)

Source

(gif, jpeg or png only, 5MB maximum file size)

Notify me about new comments ONLY FOR THIS TIP

Notify me about new comments ANYWHERE ON THIS SITE

Hide my email address

What is six more than 8?

2017-07-10 17:30:52

Julie

Doesn't work for me in Excel 2016. I put #":"00 and the time entry is always :## (e.g., I enter 11:30 and it puts in :11) I even tried add 2 more 00, like this: #00":"00 thinking it was missing the front half of the format, but that produced the same results.

Please help me. I need to add data validation rule that a person can only enter our ordernumber "AA000000" (2 alphanumeric and 6 numeric - no special characters or spacing allowed). What will be the formula (or edit mask) for this?

2014-12-03 12:39:58

Rose Taylor

I am trying to do an input mask to format a number if it is 7 digits long. If its seven digits long I want the number to appear as #####-##, but if ifs 5 digits long I just want it to look like #####. How do I do this with an input mask or should I use an IF statement for that cell?

2014-02-13 07:03:03

Fcaetus

Thanks

2013-02-24 19:12:08

Joze

I am sorry, there is an error in my formula: the right expression is:=timevalue(text(a3;"00:00"))

2013-02-23 09:53:08

Joze

Nice solution. You get the same result if you use a formula =TIMEVALUE(TEXT(A3;"00 0")). But in this case, if you want to sum time data you have to format cell in which the result should be as "[h]mm:ss". Am I right?