Results 1 to 9 of 9

Thread: Help me with entering times in Excel

  1. #1
    Board Regular
    Join Date
    Oct 2010
    Location
    Halesowen, West Midlands
    Posts
    367
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Help me with entering times in Excel

    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 "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.

  2. #2
    Board Regular
    Join Date
    Nov 2006
    Location
    London
    Posts
    8,259
    Post Thanks / Like
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Help me with entering times in Excel

    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 by Special-K99; Oct 17th, 2019 at 09:16 AM.

  3. #3
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    11,239
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Help me with entering times in Excel

    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 by MARK858; Oct 17th, 2019 at 09:31 AM.
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  4. #4
    Board Regular
    Join Date
    Oct 2010
    Location
    Halesowen, West Midlands
    Posts
    367
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help me with entering times in Excel

    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?

  5. #5
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    11,239
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Help me with entering times in Excel

    @halesowenmum, you can always use Data validation to force the users to enter it in a recognised time format.
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  6. #6
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    51,042
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Help me with entering times in Excel

    Here is a good article that shows you to apply the Time Data Validation Mark is talking about:
    https://wmfexcel.com/2014/08/10/data-validation-time/
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  7. #7
    Board Regular
    Join Date
    Nov 2006
    Location
    London
    Posts
    8,259
    Post Thanks / Like
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Help me with entering times in Excel

    Quote Originally Posted by MARK858 View Post
    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)

  8. #8
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    11,239
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Help me with entering times in Excel

    Quote Originally Posted by Special-K99 View Post
    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 by MARK858; Oct 17th, 2019 at 11:41 AM.
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  9. #9
    Board Regular
    Join Date
    Oct 2010
    Location
    Halesowen, West Midlands
    Posts
    367
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help me with entering times in Excel

    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

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •