+ Reply to Thread
Results 1 to 8 of 8

time is not be extracted correctly

  1. #1
    Registered User
    Join Date
    12-08-2017
    Location
    Hannover
    MS-Off Ver
    2007
    Posts
    7

    time is not be extracted correctly

    good morning,

    i have a little problem. i couldn't find anything that can help me in my situation.

    i have extracted the date and the time from a cell where was both inside.

    it looks like it is correct, but if i write the same date and the same time by hand in other cells and let the macro compare them, it says the date is correct but not the time. i tried formatting it in different ways. hh:mm:ss is the way i need but other formattings like hh:mm or h:mm:ss doesn't work either.

    https://www.excelforum.com/attachmen...1&d=1516084679

    i should add another informations: the upper button "Zählen" is the button to extract the date and the time.
    and after the extraction, if i click into the cell where the time has been extracted to to edit it and then compare it with the macro "Rüstwechsel"-button it works

    Thanks and greetings
    Last edited by freakyOne; 01-16-2018 at 02:44 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: time is not be extracted correctly

    Attach your file HERE.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-08-2017
    Location
    Hannover
    MS-Off Ver
    2007
    Posts
    7

    Re: time is not be extracted correctly

    oh sry, yeah i tried the icon, but it didn't work. That's why i have used another uploader.

    https://www.excelforum.com/attachmen...1&d=1516084679

    i hope i uploaded it correctly this time.

    sorry and thanks for the info

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: time is not be extracted correctly

    If you are referring to E2 and F2 being extracted from F2, then they are correct date and time. What is not being done correctly for you?

    To extract the date, you could use...
    =INT(D2)
    and for the time...
    =MOD(D2,1)
    format each as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    12-08-2017
    Location
    Hannover
    MS-Off Ver
    2007
    Posts
    7

    Re: time is not be extracted correctly

    the problem is the compare!

    in cell F2 is the same time like in O14. But if you press the lower Button. it says "Uhrzeit falsch" which means "Time wrong" instead of "Uhrzeit korrekt" which means "time correct"

    But in cell F2 and O14 is the same time: 06:01:23

    so how can the compare say it is nto the same time :O

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: time is not be extracted correctly

    I get "correct" when I try your code?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: time is not be extracted correctly

    Aslo, keep in mined that when dealing with time, it is a decimal of 1 (day), and as such, could be up to 14 decimal places, but only show a few minutes. if the compare is not exact out to that many decimals, it will return FALSE. perhaps try rounding them both to, say, 10 decimals?

  8. #8
    Registered User
    Join Date
    12-08-2017
    Location
    Hannover
    MS-Off Ver
    2007
    Posts
    7

    Re: time is not be extracted correctly

    i have found the difference after transforming it to a number.

    the one is 0,250960648148148 and the other one is 0,250960648147156

    how can this be? is there a way to compare the text i see and not the value?



    ps you need to press the first button first and then the lower one. cause when i uploaded the file i already clicked before into the cell. thats why it says it is correct.

    just press "Zählen" first then "Rüstwechsel".

+ 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. Replies: 3
    Last Post: 08-12-2017, 01:48 AM
  2. [SOLVED] Formula to add network time to leave time not working correctly
    By mlm2832 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2014, 12:45 AM
  3. [Solved] Not showing time correctly
    By krypton80 in forum Excel General
    Replies: 2
    Last Post: 11-28-2013, 12:24 PM
  4. Replies: 2
    Last Post: 08-12-2013, 02:38 PM
  5. [SOLVED] Extracted time from date/time field does not flag on =IF(TIME function.
    By Vlad717 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 03:29 PM
  6. [SOLVED] Time values from extracted text strings
    By Steve Roth in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-08-2012, 01:39 PM
  7. Converting military time to decimal time not rounding correctly
    By Sean Anderson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2008, 09:12 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