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)
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about
Excel Formula:
=DATE(MID(B2,7,5),MONTH(LEFT(B2,6)),MID(B2,5,2))
 
Upvote 0
Thank you so much. It is working. But want to ask a question please, why that formula. Do I need to use that formula all the time or on specific cases? How do I know. Because I have been told here most cases will be solved by PasteSpecial or datevalue(), timevalue() etc. Thank you again.
 
Upvote 0
Just depends on the data & your date settings
 
Upvote 0
I am pretty sure the issue here is that you need a space before the AM & PM.
Try doing a replace "AM" with " AM"
 
Upvote 0
That makes no difference for me, but may work if you have US style date format.
 
Upvote 0
I have logged out for the day but it definitely made a difference in the mobile app and I am pretty sure I have had it before on the desktop too. My regional format is dd/mm/yyyy.
 
Upvote 0
Thank you so much. It is working. But want to ask a question please, why that formula. Do I need to use that formula all the time or on specific cases?
What formula you would need to use might depend on where in the world you are located (your profile does not say). For the data you displayed, Fluff's formula should work for anyone's locale. I am located in the US so, for me, this simpler formula also worked (but it probably would not work for someone in England say)...

=0+REPLACE(LEFT(B2,11),7,0,",")

although what it returns is the date as a serial number so you have to format the cell with the date format pattern you want it to display as.

SIDE NOTE: Did you see my response to your "first cell in a range/table" question yet (I think my response answers your question)?
 
Last edited:
Upvote 0
I have logged out for the day but it definitely made a difference in the mobile app and I am pretty sure I have had it before on the desktop too. My regional format is dd/mm/yyyy.

I have just had a chance to test this out on my desktop. And Fluff was of course correct.
Also there are some differences between the Desktop version and the Online & Mobile versions.
 
Upvote 0
The test results looks like this.
(for even a chance at conversion it needs both the comma and the space)

1622349697694.png
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

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