date and time cells are not changing to numbers

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I tried to pasteSpecial and mutiply by 1, I tried to use datevalue() function but date and time in column B are not changing. Any idea would be very much appreciated. The link to the file is below.



dateandtime.xlsx
ABCDEF
1IDOrdered AtDay
21656098Jul 13 2020 12:15PM#VALUE!MonTRUE
31710182Oct 9 2020 11:45AMFriTRUE
41710256Oct 9 2020 12:42PMFriTRUE
51656942Jul 14 2020 11:39AMTueTRUE
61657357Jul 14 2020 4:13PMTueTRUE
71657321Jul 14 2020 3:43PMTueTRUE
81656855Jul 14 2020 11:01AMTueTRUE
91657429Jul 14 2020 4:40PMTueTRUE
101653857Jul 8 2020 3:31PMWedTRUE
111653190Jul 8 2020 9:57AMWedTRUE
121653194Jul 8 2020 10:00AMWedTRUE
131654194Jul 9 2020 9:41AMThuTRUE
141654272Jul 9 2020 10:45AMThuTRUE
151654358Jul 9 2020 11:38AMThuTRUE
161657024Jul 14 2020 12:23PMTueTRUE
171653895Jul 8 2020 3:45PMWedTRUE
181654520Jul 9 2020 12:56PMThuTRUE
191654523Jul 9 2020 12:58PMThuTRUE
date andtime
Cell Formulas
RangeFormula
C2C2=DATEVALUE(B2)
F2:F19F2=ISTEXT(B2)
 
It would need to be 13 Mar rather than Mar 13 in the comma version on a UK desktop.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
It would need to be 13 Mar rather than Mar 13 in the comma version on a UK desktop.
For the date only, I think this formula will work everywhere (obviously it works in the US locale)...

=0+MID(REPLACE(B2,8,0,LEFT(B2,4)),5,11)

Again, the cell with this formula needs to be formatted with the date format of the OP's choosing.
 
Upvote 0
For the date only, I think this formula will work everywhere (obviously it works in the US locale)...

=0+MID(REPLACE(B2,8,0,LEFT(B2,4)),5,11)

Again, the cell with this formula needs to be formatted with the date format of the OP's choosing.
Book1
BC
2Mar 13, 2021 11:00#VALUE!
Sheet1
Cell Formulas
RangeFormula
C2C2=0+MID(REPLACE(B2,8,0,LEFT(B2,4)),5,11)


on a UK version
 
Upvote 0
Really? I surely thought that arrangement worked everywhere. Maybe it was with dashes instead of spaces that I am thinking of...
Excel Formula:
=0+TEXT(MID(REPLACE(B2,8,0,LEFT(B2,4)),5,11),"dd-mmm-yyyy")
 
Upvote 0
Really? I surely thought that arrangement worked everywhere. Maybe it was with dashes instead of spaces that I am thinking of...
Excel Formula:
=0+TEXT(MID(REPLACE(B2,8,0,LEFT(B2,4)),5,11),"dd-mmm-yyyy")

dd-mmm-yyyy hh:mm AM/PM worked for me with both an Australian & US regional setting.
(if I use the 2 digit mm it appears to work until I add in the time element)
For a 2 digit version yyyy-mm-dd hh:mm AM/PM works
 
Upvote 0
yyyy-mm-dd works everywhere (just about) as it complies with the International ISO standard for dates (ISO 8601), and Excel complies with the standard.
 
Last edited:
Upvote 0
Thank you all for the help. I just tried to use Power Query, I went to Data-->From table and to my surprise the column date (Order at) was converted to right date (number, moved to the right hand side). I could not believe it. So even without doing anything PowerQuery changed to right format then I load it to Excel and got everything fixed. Does that mean all Date/Time format issues can be resolved by PowerQuery, just as simple as loading them to PowerQ and it will do it for me. I am shocked to be honest.
 
Upvote 0
Thank you all for the help. I just tried to use Power Query, I went to Data-->From table and to my surprise the column date (Order at) was converted to right date (number, moved to the right hand side). I could not believe it. So even without doing anything PowerQuery changed to right format then I load it to Excel and got everything fixed. Does that mean all Date/Time format issues can be resolved by PowerQuery, just as simple as loading them to PowerQ and it will do it for me. I am shocked to be honest.

Clearly it is never going to be "all" but PQ is pretty good at interpreting dates. If it is in a date format that is different to the one in your Region, there is a "use locale" option where you tell PQ which Region the data if from and that will help it convert it to your format eg if your format is d/mm/yyyy and the input is in the format mm/dd/yyyy, you need to tell it the file is from English (United States).
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,762
Members
449,048
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top