+ Reply to Thread
Results 1 to 6 of 6

Trying to convert number to date and time. 0 is proving to be a problem. File attached

  1. #1
    Registered User
    Join Date
    05-11-2009
    Location
    Belfast
    MS-Off Ver
    Excel 2019
    Posts
    66

    Unhappy Trying to convert number to date and time. 0 is proving to be a problem. File attached

    I am getting a basic extract of info from a server.

    It is my intention to be able to get the date and time in on cell and then subtract the information from the date and time the report was run to highlight any events that are 20 minutes or more earlier than the report extract date and time.

    I have attached a file to show (Excel 2010) that I get a column of dates showing 081112 (DD/MM/YY) and time as 051148 (HH/MM/SS).

    I can't seem to format just the cell to show a date or time. As you see in the attached I have attempted a solution which seems to work unless the first char is a 0 which totally buggers it up.

    Thanks in advance

    Sample.xlsx

  2. #2
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Trying to convert number to date and time. 0 is proving to be a problem. File attached

    Hi Jaywizz,

    Someone my come in with a simpler solution, but the attached seems to do what your after. Give it a go and let us know.

    Dave H
    Attached Files Attached Files
    - Mark your post [SOLVED] if it has been answered satisfactorily, by editing your original post using advanced mode.
    - Thank those that provided useful help, its nice and its very well appreciated...use the star on the lower left of the post

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Trying to convert number to date and time. 0 is proving to be a problem. File attached

    What would a June 20, 2012 look like from the data base; 200512 or 20512?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Trying to convert number to date and time. 0 is proving to be a problem. File attached

    Try this formula

    =(IF(LEN(A3)=5,LEFT(A3,1)&"/"&MID(A3,2,2),LEFT(A3,2)&"/"&MID(A3,3,2)) &"/"&RIGHT(A3,2))+0
    Does that work for you?

  5. #5
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Trying to convert number to date and time. 0 is proving to be a problem. File attached

    Hi - I have put a small code to get the proper dates (recognized by excel) in Column O:

    Please Login or Register  to view this content.
    Could you please let us know if this works for you. If if does, we can tweak it a bit to do factor the time as well.

    Thansk,
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  6. #6
    Registered User
    Join Date
    05-11-2009
    Location
    Belfast
    MS-Off Ver
    Excel 2019
    Posts
    66

    Re: Trying to convert number to date and time. 0 is proving to be a problem. File attached

    Folks thats great all of your solutions worked. You have saved many lives

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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