Help me with entering times in Excel

halesowenmum

Active Member
Joined
Oct 20, 2010
Messages
380
Office Version
365
Platform
Windows
Hi all.

I've got some cells where I want to enter times of the day (and be able to do calculations on them so they probably can't be text).

I've got the cells formatted as Time and then using Custom and have formatted to hh:mm.

So I do that and it shows like that.

However. When I type into that cell for example "10:00" I don't get 10:00 showing, I get 00:00:00 and in the formula bar it changes to/shows "[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]10/01/1900 00:00:00".

I just want users to simply, easily and accurately be able to type in the times they arrive and leave places in a numerical time format.

Do I need VBA or a formula to sort this out and how do I handle am and pm?

Thank you.
[/FONT]
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,342
Works for me based on your description.
You need to type 10:00 including the colon and the minutes, not just 10.
Looks like you just typed 10
If it still doesnt work create a new workbook, do what you did before and see if that cures the problem.
If so it would point to a problem with your workbook/worksheet.

10:00 is 10AM
22:00 is 10PM

Entering AM into the cell would turn it into text
 
Last edited:

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
Entering AM into the cell would turn it into text
If I enter 10 AM in a cell (with the space) it doesn't turn it into text, it remains in time format and =ISNUMBER(The cell reference) returns TRUE.
 
Last edited:

halesowenmum

Active Member
Joined
Oct 20, 2010
Messages
380
Office Version
365
Platform
Windows
Thank you Special-K99, I can work with 10:00 and 22:00 that's fine. I'll just provide instructions of how they should enter times into cells.

However....
I've worked lots with end users and I
know
some won't know how to do a colon, some WILL inevitably type "10" for 10.00 am and then it'll all go to pot and I can just imagine the poor quality data I'll be capturing and just trying to think of ways to limit erroneous entries - is there any more I can do to accommodate this requirement?
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
@halesowenmum, you can always use Data validation to force the users to enter it in a recognised time format.
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,342
If I enter 10 AM in a cell (with the space) it doesn't turn it into text, it remains in time format and =ISNUMBER(The cell reference) returns TRUE.
Entering 10AM produces text (note no space)
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
Entering 10AM produces text (note no space)
Yes but the act of adding AM to the cell doesn't turn it to text, it is the lack of the space with the AM so this statement

Entering AM into the cell would turn it into text
is incorrect.

Data validation though from the OP's post would do away with these types of issues.
 
Last edited:

halesowenmum

Active Member
Joined
Oct 20, 2010
Messages
380
Office Version
365
Platform
Windows
Thanks all for the above.

I've added data validation in the relevant cells in the form of an instructional Input Message and setting it to flag up as an error if they try and enter the wrong thing - thank you for all your help with this.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,592
Messages
5,487,745
Members
407,609
Latest member
Chrissie1970

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top