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

Written by Allen Wyatt (last updated May 12, 2018)
This tip applies to Excel 97, 2000, 2002, and 2003


1

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:

  1. Select the cells you want to use for time input.
  2. Choose Format from the Cells menu. Excel displays the Format Cells dialog box.
  3. Make sure the Number tab is displayed. (See Figure 1.)
  4. Figure 1. The Number tab of the Format Cells dialog box.

  5. In the Category list, choose Custom.
  6. Replace whatever is in the Type box with #":"00 (a pound sign, quote mark, colon, quote mark, and two zeros).
  7. 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. ...

MORE FROM ALLEN

Changing Orientation of a Text Box

Want to change how a text box is oriented on the page? You can't do it, but you can adjust the dimensions of the box ...

Discover More

Putting Character Codes to Work

If you know the character codes for some characters of interest, you can use those codes to do lots of tasks. This tip ...

Discover More

Changing the Size of a Graphic

Word allows you to add more than text to your documents; you can also add graphics. Once added, you can modify the size ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Combining Multiple Rows in a Column

Do you need to concatenate the contents of a range of cells in the same column? Here's a formula and a handy macro to ...

Discover More

Noting When a Workbook was Changed

Do you need to know when a workbook was last changed? There are a couple of ways you can go about keeping track of the ...

Discover More

Moving and Copying Cells

At the very heart of editing is the ability to move and copy cells in a worksheet. Understanding the differences between ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

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}] (all 7 characters, in the sequence shown) 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.

What is 5 - 3?

2019-10-24 08:39:35

Humberto

Allen Wyatt, good one! Thanks a lot. :)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.