Weird Date/Time formatting

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,531
Office Version
365
Platform
Windows
In that case you should always state that, as Excel & Sheets are not the same.
You should also have posted this in the General Discussion section.
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Ronderbecke

Board Regular
Joined
Oct 4, 2017
Messages
54
I am not sure I made this work quite right? When converting it didn't process through correctly and formatting the new column to date/time shows this:


2020-07-03T13:30:52-04:0012/30/1899 0:00:00
2020-07-03T15:00:55-04:0012/30/1899 0:00:00
2020-07-07T14:00:43-04:0012/30/1899 0:00:00
2020-07-03T17:30:40-04:0012/30/1899 0:00:00
2020-07-08T10:00:47-04:0012/30/1899 0:00:00
2020-07-01T11:00:09-04:0012/30/1899 0:00:00
2020-07-01T18:30:02-04:0012/30/1899 0:00:00
2020-07-03T11:00:45-04:0012/30/1899 0:00:00

I used this formula: =ARRAYFORMULA(LEFT(SUBSTITUTE('Form Responses 1'!L2:L,"T",""),18)+0)

Does the arrayformula cause an issue in the adjustment?
It appears something weird was going on because I reformatted with date and time, but it actually shows this:


7/3/2020 1:30 PM
7/3/2020 3:0 PM
7/7/2020 2:0 PM
7/3/2020 5:30 PM
7/8/2020 10:0 AM
7/1/2020 11:0 AM
7/1/2020 6:30 PM
7/3/2020 11:0 AM

Any one know why it would cut off a 0 after the first one but only on some of them?
 

Ronderbecke

Board Regular
Joined
Oct 4, 2017
Messages
54
In that case you should always state that, as Excel & Sheets are not the same.
You should also have posted this in the General Discussion section.
Sorry about that, I did not realize that. Is there a way to move it?
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,903
Office Version
2016
Platform
Windows
The custom format that you've applied is "d/m/yyyy h:m AM/PM" and so only one digit is used for the minutes if it can get away with it! Change the format string to: "d/m/yyyy h:mm AM/PM" should correct it.

Additionally my formula is slightly wrong it should read: =LEFT(SUBSTITUTE(A1,"T"," "),19)+0 it only affects whether the seconds are converted correctly so you'd probably not notice.

HTH
 

Ronderbecke

Board Regular
Joined
Oct 4, 2017
Messages
54
The custom format that you've applied is "d/m/yyyy h:m AM/PM" and so only one digit is used for the minutes if it can get away with it! Change the format string to: "d/m/yyyy h:mm AM/PM" should correct it.

Additionally my formula is slightly wrong it should read: =LEFT(SUBSTITUTE(A1,"T"," "),19)+0 it only affects whether the seconds are converted correctly so you'd probably not notice.

HTH
Wonderful, strange that it didn't work until i reformatted to a different date/time and then went back and added it. Thanks so much for your help on that, it worked great!
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,903
Office Version
2016
Platform
Windows
a pleasure to have helped and thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,117
Messages
5,484,842
Members
407,469
Latest member
moshea

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top