convert to a valid date and time

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
289
Office Version
  1. 365
Platform
  1. Windows
I have these date and time formats. I tried different date and time function but are not working. How can I convert these to become a valid date and time format (mm-dd-yyyy hh:mm:ss) ..many thanks


10-28-2021 | 08:57:12​
10-28-2021 | 08:51:14​
10-28-2021 | 08:51:14​
10-28-2021 | 08:41:34​
10-28-2021 | 08:41:34​
10-28-2021 | 08:22:55​
10-28-2021 | 08:22:55​
10-28-2021 | 08:21:34​
10-28-2021 | 08:21:34​
10-28-2021 | 08:20:43​
10-28-2021 | 08:20:43​
10-28-2021 | 08:20:28​
10-28-2021 | 08:20:28​
10-28-2021 | 08:10:04​
10-28-2021 | 08:10:04​
10-28-2021 | 08:07:55​
 
Quite a few of the posts seem to be ignoring this mdy comment and providing solutions using dd/mm/yyyy.
I would have expected Peter's option to work but failing that Post #8 from @kvsrinivasamurthy should work for all regions but ignore his B2 formatting suggestion which seems inconsistent with your mdy comment, in favour of your own preferred date/time formatting.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Data in A2. In B2
Excel Formula:
=DATE(MID(A2,7,4), LEFT(A2,2),MID(A2,4,2))+VALUE(MID(A2,FIND("| ",A2)+2,8))
Format the cell B2 for dd/mm/yyyy hh:mm:ss
Date and month should have 2 digits . Otherwise we have to change formula.
Eg For Sep it should be 09
thanks brother.. this works fine
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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