Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Using an Input Mask.

Using an Input Mask

Written by Allen Wyatt (last updated March 17, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


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. Display the Home tab of the ribbon.
  3. Click the small icon at the bottom-right of the Number group. Excel displays the Number tab of the Format Cells dialog box.
  4. In the Category list, choose Custom. (See Figure 1.)
  5. Figure 1. The Number tab of the Format Cells dialog box.

  6. Replace whatever is in the Type box with #":"00 (a hash mark, 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)+(MOD(A3,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 (12550) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel 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

Adding Tabs at the Beginning of a Line

Press a tab at the beginning of a paragraph, and Word normally assumes you want to indent the paragraph. If you don't ...

Discover More

Adjusting Times for Time Zones

Collect a series of times in a worksheet, and you might need to adjust those times for various time zones. This involves ...

Discover More

Setting Default Options for Track Changes

The Track changes feature in Word is a great help in editing documents, particularly if you are working with others or ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Stopping Feet and Inches from Converting to Dates

When pasting information into a worksheet, Excel tries to helpfully convert that information. This can cause undesired ...

Discover More

Changing Limited Relative References to Absolute

Do you need to change whether a particular reference in a formula uses a relative or absolute reference? If so, you may ...

Discover More

Moving More than One Cell to the Right

Enter some data in a cell, and Excel typically moves to the next cell when you press Enter. If you want to move more than ...

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 two more than 4?

2018-02-10 13:50:07

Willy Vanhaelen

You can also consider to use an event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
If Not IsNumeric(Target) Then Exit Sub
Application.EnableEvents = False
Target = Int(Target / 100) & ":" & Right(Target, 2)
Application.EnableEvents = True
End Sub

This example works for hours entered in column A.
This column can now only be used to enter time without a colon.
To use another column: change the (column) number on the first line of the macro.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.