Help me with entering times in Excel

halesowenmum

Active Member
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]
 

Special-K99

Well-known Member
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

Well-known Member
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
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

Well-known Member
@halesowenmum, you can always use Data validation to force the users to enter it in a recognised time format.
 

Special-K99

Well-known Member
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

Well-known Member
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
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.
 

Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Macro to copy values across rows and transposing them and add the user id
    [FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]Hi,[/COLOR][/SIZE][/FONT] [FONT=Times New...
Top