+ Reply to Thread
Results 1 to 42 of 42

Frustrating conversion to a time and date

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Angry Frustrating conversion to a time and date

    Hi there,

    So I'm using Excel for Mac v15 and I have this CSV with the dates a little mixed up. I'm trying to make them all uniform AND separate date from time. So, as you can imagine, I've used Text-to-columns and spent about 4 hours so far to try to get this sorted.

    Of course, not happening. Somewhere along the line it worked, but did the following:
    Date has date, but also 00:00 in the end like 01/04/2017 0:00. And the time if it was 13.01, it becomes 01:01 (totally flipping the am/pm)

    Does anyone have a solution?

    Screen Shot 2017-06-20 at 2.23.29 PM.png

  2. #2
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Frustrating conversion to a time and date

    Check out this thread: https://www.excelforum.com/excel-gen...e-columns.html

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Frustrating conversion to a time and date

    Hi all- Could you be more specific about what you're trying to achieve?
    1) Do you want to convert the text to NUMBERS or just re-format as TEXT.
    2) In either case, what do you want the output to look like EXACTLY?

  4. #4
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by leelnich View Post
    Hi all- Could you be more specific about what you're trying to achieve?
    1) Do you want to convert the text to NUMBERS or just re-format as TEXT.
    2) In either case, what do you want the output to look like EXACTLY?
    Want it to look like the way it is in green boxes.
    Screen_Shot_2017-06-20_at_3_17_02_PM.png

  5. #5
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by LeoTaxi View Post
    Or

    in B2
    Please Login or Register  to view this content.
    in C2
    Please Login or Register  to view this content.
    Kind regards
    Leo
    From thread referenced above which was created yesterday!

  6. #6
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by Raphaelp View Post
    From thread referenced above which was created yesterday!
    Hi,

    I was just replying to you to say how that solution hasn't worked.
    Here you go:


    Screen Shot 2017-06-20 at 3.24.49 PM.png

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Frustrating conversion to a time and date

    Try these:

    B2 =IFERROR(DATEVALUE(LEFT(A2,10)),INT(A2))
    C2 =IFERROR(TIMEVALUE(RIGHT(A2,5)),MOD(A2,1))

    Formatted appropriately.

  8. #8
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by 63falcondude View Post
    Try these:

    B2 =IFERROR(DATEVALUE(LEFT(A2,10)),INT(A2))
    C2 =IFERROR(TIMEVALUE(RIGHT(A2,5)),MOD(A2,1))

    Formatted appropriately.
    Wow, time worked!! Thanks!!
    But date is still patchy :/

    Screen_Shot_2017-06-20_at_3_17_02_PM.png
    Attached Images Attached Images

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by Yourname View Post
    Wow, time worked!! Thanks!! But date is still patchy :/
    It is working on my end. Might have something to do with the different regional settings.

    Can you upload a copy of your workbook? This should help us figure out what is going on better than a picture.

  10. #10
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by 63falcondude View Post
    It is working on my end. Might have something to do with the different regional settings.

    Can you upload a copy of your workbook? This should help us figure out what is going on better than a picture.
    Here you go.

  11. #11
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Umm, not sure why but when I click the attach icon, it doesn't drop down...

  12. #12
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Hope it's here now
    Attached Files Attached Files

  13. #13
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Frustrating conversion to a time and date

    For the date:

    Assuming the first 2 numbers ("01") are the month try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  14. #14
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by Arkadi View Post
    For the date:

    Assuming the first 2 numbers ("01") are the month try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks, but that worked for one part, but not the other:

    Screen_Shot_2017-06-20_at_4_07_36_PM.png

  15. #15
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Frustrating conversion to a time and date

    Yeah forgot to account for the format that does work... how about:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by Arkadi View Post
    Yeah forgot to account for the format that does work... how about:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    LOL this one has a whole different result...

    Screen_Shot_2017-06-20_at_4_21_00_PM.png

  17. #17
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Frustrating conversion to a time and date

    Try this in B2

    =IFERROR(DATEVALUE(LEFT(A2,10)),DATE(YEAR(A2),DAY(A2),MONTH(A2)))

    If that does not produce the desired results, what does =MONTH(A5) return?

  18. #18
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    The large formula didn't work, and =MONTH(A5) returned 4.

  19. #19
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Frustrating conversion to a time and date

    What do you mean by "didn't work"? After you entered the first formula from post #17 into B2, what did it return?

    In the attached workbook, I put the following formulas in B2 and C2:

    B2 =IFERROR(DATEVALUE(LEFT(A2,10)),DATE(YEAR(A2),DAY(A2),MONTH(A2)))
    C2 =IFERROR(TIMEVALUE(RIGHT(A2,5)),MOD(A2,1))
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by 63falcondude View Post
    What do you mean by "didn't work"? After you entered the first formula from post #17 into B2, what did it return?

    In the attached workbook, I put the following formulas in B2 and C2:

    B2 =IFERROR(DATEVALUE(LEFT(A2,10)),DATE(YEAR(A2),DAY(A2),MONTH(A2)))
    C2 =IFERROR(TIMEVALUE(RIGHT(A2,5)),MOD(A2,1))
    Sorry, I mean it gave that error:


    Screen_Shot_2017-06-20_at_9_27_16_PM.png

    Super weird, but I opened your workbook and:


    Screen Shot 2017-06-20 at 9.28.57 PM.png

  21. #21
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Frustrating conversion to a time and date

    That is so weird. It works fine on my end. One more shot

    B2 =IF(ISTEXT(A2),DATE(MID(A2,7,4),LEFT(A2,2),MID(A2,4,2)),DATE(YEAR(A2),DAY(A2),MONTH(A2)))

    Formatted as a date.

  22. #22
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by 63falcondude View Post
    That is so weird. It works fine on my end. One more shot

    B2 =IF(ISTEXT(A2),DATE(MID(A2,7,4),LEFT(A2,2),MID(A2,4,2)),DATE(YEAR(A2),DAY(A2),MONTH(A2)))

    Formatted as a date.
    WOW you guys are simply the best!!!! It worked!!! Thanks a super tonnnnn!!!!!


    Screen_Shot_2017-06-20_at_10_10_29_PM.png


    But I copied the formula all the way to the bottom and noticed that the rows that had the SAME format as A2/3/4 are still not converting:


    Screen_Shot_2017-06-20_at_10_14_27_PM.png

  23. #23
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Frustrating conversion to a time and date

    This should be pretty simple
    Enter formula in B2 to extract Date
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter formula in C2 to extract Time
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Format cells B2 as Date and C2 as Custom, h:mm and copy both formulas down
    Please see attached.
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  24. #24
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by AlKey View Post
    This should be pretty simple
    Enter formula in B2 to extract Date
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter formula in C2 to extract Time
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Format cells B2 as Date and C2 as Custom, h:mm and copy both formulas down
    Please see attached.
    Thanks much for your reply!
    Unfortunately, that didn't work either.

    The previous formula given by 63falcondude worked, and worked for most of the column but stopped short. So I tried yours, and it didn't work on any of the fields. I'm telling you Excel hates me even when so many of you gurus are so generously taking time out to help me



    Screen Shot 2017-06-21 at 8.38.31 AM.png

  25. #25
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    I know this has become super frustrating for all you gurus... but pleeassseee don't give up. You're my only hope lol

  26. #26
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Frustrating conversion to a time and date

    I was out yesterday... why don't you just select column A and press ctrl+H. Find what:, [comma] Replace with:[leave this blank], then click "Replace All".

    Then do as I wrote above and see what happens:

    Quote Originally Posted by RaphaelP;
    In B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  27. #27
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Frustrating conversion to a time and date

    The tough part is none of us seem to be able to replicate many of your errors.... and the formats are incredibly inconsistent, some text, some date/time, and of the date/time ones, sometimes a leading 0 for single digit hours or months, while other times no leading 0's, I also see some dates are month/day and some day/month.

    How is the data initially obtained? It may be easier to fix the source of the data collection... I think you mentioned csv, but how is that generated?

  28. #28
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by Arkadi View Post
    The tough part is none of us seem to be able to replicate many of your errors.... and the formats are incredibly inconsistent, some text, some date/time, and of the date/time ones, sometimes a leading 0 for single digit hours or months, while other times no leading 0's, I also see some dates are month/day and some day/month.

    How is the data initially obtained? It may be easier to fix the source of the data collection... I think you mentioned csv, but how is that generated?
    I got that sent to me by someone. There's too many variables on how the data got added there, lol.. so going through source would be out. Does it matter that I'm on the Mac OS version of Excel? Maybe that's why I'm getting these errors?

    Quote Originally Posted by Raphaelp View Post
    I was out yesterday... why don't you just select column A and press ctrl+H. Find what:, [comma] Replace with:[leave this blank], then click "Replace All".

    Then do as I wrote above and see what happens:
    Thank you sir... it still gave me an error
    Here you go.

    Screen Shot 2017-06-22 at 4.43.49 PM.png

    Also attaching the file with progress thus far.

  29. #29
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Here's the devil file
    Attached Files Attached Files

  30. #30
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Frustrating conversion to a time and date

    Try the following formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  31. #31
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Frustrating conversion to a time and date

    Nice jete... I was thinking same.... Hope it works!

  32. #32
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Frustrating conversion to a time and date

    I think what needs to done is after you ran the formula do copy and paste values only. This way excel will properly convert to the local regional settings.
    This formula is for Dates
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and for Time
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  33. #33
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Frustrating conversion to a time and date

    Here is another version of the formula I proposed earlier:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Edit: @ Arkadi, much appreciated.
    Last edited by JeteMc; 06-22-2017 at 10:30 PM.

  34. #34
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Guys, for real, I am astounded as to how much you guys are trying to help and I am super embarrassed that there's nothing much I am able to do other than copy/paste I apologize, but I am very thankful.

    Quote Originally Posted by JeteMc View Post
    Try the following formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Ugh...it gave me numbers

    Jun_19_-_9am.png
    Quote Originally Posted by AlKey View Post
    I think what needs to done is after you ran the formula do copy and paste values only. This way excel will properly convert to the local regional settings.
    This formula is for Dates
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and for Time
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It gave me that famous VALUE error! So frustrating!
    But in other news, your Excel file that you gave me worked flawlessly and it came out so neatly!!! Everything on your sheet works! So weird!

    Quote Originally Posted by JeteMc View Post
    Here is another version of the formula I proposed earlier:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Edit: @ Arkadi, much appreciated.
    Same error as the one I showed in the screenshot above man

  35. #35
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Frustrating conversion to a time and date

    I guess my idea worked! This was the only way to get it done. Formulas worked fine on our side but when the file was sent to you, you would get errors. So, after I ran formulas I copied new Dates and Time and used Paste Special values only. This would remove formulas and leave Dates and Time only.
    Glad it worked out for you.

  36. #36
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Frustrating conversion to a time and date

    As an aside... the "numbers" you got as a result in some cells do actually represent a date, the cells are likely just not formatted with a specific date format.

  37. #37
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Frustrating conversion to a time and date

    As Arkadi states the numbers in cells B862 and down, as shown in the screenshot in post #34, are the number of days since Jan. 1st, 1900. To get those cells to display as dates press the Ctrl and 1 keys, and apply the same date formatting (yyyy/mm/dd;@) as is applied in the other cells in that column.
    Let us know if you have any questions.

  38. #38
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by AlKey View Post
    I guess my idea worked! This was the only way to get it done. Formulas worked fine on our side but when the file was sent to you, you would get errors. So, after I ran formulas I copied new Dates and Time and used Paste Special values only. This would remove formulas and leave Dates and Time only.
    Glad it worked out for you.
    Super strange because I tried the same thing and it wouldn't work. If all the positions are the same, I'm going to just copy paste it in to the original sheet.

    Quote Originally Posted by JeteMc View Post
    As Arkadi states the numbers in cells B862 and down, as shown in the screenshot in post #34, are the number of days since Jan. 1st, 1900. To get those cells to display as dates press the Ctrl and 1 keys, and apply the same date formatting (yyyy/mm/dd;@) as is applied in the other cells in that column.
    Let us know if you have any questions.
    Thanks guys!
    Here you go, I tried doing what you said ... and it still wouldn't work with tht formula

    It's a video.

  39. #39
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Frustrating conversion to a time and date

    The video show formatting being applied to A862.
    The formatting needs to be applied to column B, especially B862 and down.
    Here is a copy of the file from post #29 with the formula and formatting applied to column B.
    Let us know if you have any questions.
    Attached Files Attached Files

  40. #40
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Quote Originally Posted by JeteMc View Post
    The video show formatting being applied to A862.
    The formatting needs to be applied to column B, especially B862 and down.
    Here is a copy of the file from post #29 with the formula and formatting applied to column B.
    Let us know if you have any questions.
    This worked! OMG wow!
    haha
    This is amazing..

    Thanks so much guys, really appreciate it.
    PS: Sorry for the delay, I was under the weather, so wasn't checking this...

  41. #41
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Frustrating conversion to a time and date

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

  42. #42
    Registered User
    Join Date
    07-09-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Frustrating conversion to a time and date

    Done, thanks again!

+ 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] Date/Time Conversion- Yet again
    By hammer2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-29-2015, 12:12 AM
  2. Long date/short date conversion and cycle time calculation
    By COGICPENNY in forum Excel General
    Replies: 1
    Last Post: 02-14-2014, 05:17 PM
  3. [SOLVED] Need help with Date/Time Conversion
    By knilsson in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-02-2014, 07:13 PM
  4. Date & time conversion
    By andyspeak in forum Excel General
    Replies: 13
    Last Post: 12-26-2013, 11:52 AM
  5. Date and time conversion to another time zone
    By RUBEN PARRAS in forum Excel General
    Replies: 1
    Last Post: 05-21-2012, 09:03 PM
  6. conversion of text to time and date
    By afgi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2010, 12:08 PM
  7. date/time conversion
    By rfcomm2k in forum Excel General
    Replies: 3
    Last Post: 03-22-2009, 08:31 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