+ Reply to Thread
Results 1 to 11 of 11

can excel convert number to time

  1. #1
    Registered User
    Join Date
    11-16-2011
    Location
    Reading, England
    MS-Off Ver
    Excel 365
    Posts
    69

    can excel convert number to time

    Is it possible to type a number e.g. 1115 and excel converts that to 11:15 am ? or say 1600 to 4:00 pm this would greatly increasethe speed that I can enter timesheets into spreadsheet. I know I can do so by using a colon but wondered if I could be a bit more lazy!

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: can excel convert number to time

    Try this ,

    Please Login or Register  to view this content.
    and change the cell format to time.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: can excel convert number to time

    See this...

    Quick Time Entry
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: can excel convert number to time

    or in an adjacent cell
    =TEXT(A1,"00\:00")+0 formatted as hh:mm
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: can excel convert number to time

    This can be done with a macro too - right click the tab name and click 'View Code', then paste the following:
    Please Login or Register  to view this content.
    Be aware this would affect any number inputted onto the sheet though - but this can be amended to check for only a certain range of cells.

    You'd also need to select the correct formatting from the cell format menu.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: can excel convert number to time

    that code wont work
    consider 1115 which is 11:15
    1115/2400
    or 1115/100/24 = 0.464583333 =11:09 which is the result of decimal time 11.15 hours

  7. #7
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: can excel convert number to time

    Oh yeah, total rookie error! Whoops.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: can excel convert number to time

    the other way do it would be format the cell as 00\:00 then use text(a1,"00\:00) in subsequent calculations
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-16-2011
    Location
    Reading, England
    MS-Off Ver
    Excel 365
    Posts
    69

    Re: can excel convert number to time

    Thanks for the formula. Unfortunately it doesn't calculate the hours worked correctly when I use it. - If a cell is left blank then an error occurs. I have attached the file I'm trying to work with. Any further help would be most appreciated!!
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: can excel convert number to time

    if the user leaves the cell "B22" blank , you could use and iferror() function to trap that but no calculations will be done and that would result in using the 0 value if you do something like this :

    Please Login or Register  to view this content.
    Or else you could do conditional formatting on these cells, so that they turn red if the cells are blank

  11. #11
    Registered User
    Join Date
    11-16-2011
    Location
    Reading, England
    MS-Off Ver
    Excel 365
    Posts
    69

    Re: can excel convert number to time

    Thanks heaps I now have a much more user friendly worksheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] convert decimal number to time : convert 1,59 (minutes, dec) to m
    By agenda9533 in forum Excel General
    Replies: 22
    Last Post: 09-15-2013, 10:43 AM
  2. Convert a number into time
    By kasossipee in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-30-2013, 04:14 PM
  3. Excel: How to convert time format into number format that can be added?
    By Frances Jones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2012, 04:10 PM
  4. Convert time to number
    By DavidBW in forum Excel General
    Replies: 2
    Last Post: 11-08-2011, 01:39 PM
  5. Convert number to time.
    By Floyd Forbes in forum Excel General
    Replies: 6
    Last Post: 08-08-2006, 05:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1