Excel 2007 time and date problem
Solved/Closed
Related:
- Excel 2007 time and date problem
- Save as pdf office 2007 - Download - Other
- Popcorn time download - Download - Movies, series and TV
- How to change whatsapp date and time - Guide
- Excel date format dd.mm.yyyy - Guide
- Ocarina of time rom - Download - Action and adventure
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 17, 2010 at 11:10 AM
Feb 17, 2010 at 11:10 AM
It is treating MDDYYYY as excel date serial.
Have you tried while bringing in the CVS data, to mark that column as DMY?
One option would be use a formula or a function to convert it into date if nothing else work.
Have you tried while bringing in the CVS data, to mark that column as DMY?
One option would be use a formula or a function to convert it into date if nothing else work.
I take it you mean the original data is in mmddyyyy?
In this situation, what I do is add an extra column and use the formula
=DATE(RIGHT(B2,4),LEFT(B2,2),MID(B2,3,2))
You can then copy and "Paste Special - Values" onto the original column and delete the extra column if required.
The time query is a little more tricky as you need to account for 4 scenarios, AM/PM and hour=12 or not 12.
There's possibly a slicker way of doing it, but the following works:
=IF(RIGHT(B2,2)="AM",IF(LEFT(B2,2)="12",TIME(LEFT(B2,2)-12,MID(B2,3,2),MID(B2,5,2)),TIME(LEFT(B2,2),MID(B2,3,2),MID(B2,5,2))),IF(LEFT(B2,2)="12",TIME(LEFT(B2,2),MID(B2,3,2),MID(B2,5,2)),TIME(LEFT(B2,2)+12,MID(B2,3,2),MID(B2,5,2))))
In this situation, what I do is add an extra column and use the formula
=DATE(RIGHT(B2,4),LEFT(B2,2),MID(B2,3,2))
You can then copy and "Paste Special - Values" onto the original column and delete the extra column if required.
The time query is a little more tricky as you need to account for 4 scenarios, AM/PM and hour=12 or not 12.
There's possibly a slicker way of doing it, but the following works:
=IF(RIGHT(B2,2)="AM",IF(LEFT(B2,2)="12",TIME(LEFT(B2,2)-12,MID(B2,3,2),MID(B2,5,2)),TIME(LEFT(B2,2),MID(B2,3,2),MID(B2,5,2))),IF(LEFT(B2,2)="12",TIME(LEFT(B2,2),MID(B2,3,2),MID(B2,5,2)),TIME(LEFT(B2,2)+12,MID(B2,3,2),MID(B2,5,2))))