re-arrange a cell that contains date/time

STEMALO

Board Regular
Joined
Apr 15, 2008
Messages
93
Hi everyone,

current cell is:
5/6/2014 7:57:24 PM

would like it to be:
2014/06/05 19:57:24

is this possible?
 

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).
Hi,

Assuming 5/6/2014 is May 6th, 2014

Just reformat the cell as yyyy/dd/mm hh:mm:ss
 
Upvote 0
Then the value in your subject cell is TEXT, not real Date/Time values.

Assuming data in A1, in an unused cell, put =ISNUMBER(A1)
What do you get?
 
Upvote 0
false

the cell is currently formatted as GENERAL.
Tried to reformat it but doesn't work.
Even tried splitting it..
 
Upvote 0
Again, assuming your sample is May 6th, and not knowing what Other dates you may have, this should do the job:


Book1
ABC
15/6/2014 7:57:24 PM2014/05/06 19:57:24
2Custom Format C1
3yyyy/dd/mm hh:mm:ss
Sheet290
Cell Formulas
RangeFormula
C1=(MID(A1,FIND("|",SUBSTITUTE(A1,"/","|",2))+1,4)&"/"&SUBSTITUTE(MID(A1,3,2),"/","")&"/"&SUBSTITUTE(LEFT(A1,2),"/","")&MID(A1,FIND(" ",A1),15))+0
 
Upvote 0
Oops, I had the day and month backwards, corrected formula below:


Book1
ABC
15/6/2014 7:57:24 PM2014/06/05 19:57:24
2Custom Format C1
3yyyy/dd/mm hh:mm:ss
Sheet290
Cell Formulas
RangeFormula
C1=(MID(A1,FIND("|",SUBSTITUTE(A1,"/","|",2))+1,4)&"/"&SUBSTITUTE(LEFT(A1,2),"/","")&"/"&SUBSTITUTE(MID(A1,3,2),"/","")&MID(A1,FIND(" ",A1),15))+0
 
Upvote 0
i can't thank you enough...it works perfectly..
Now going to open a beer and reverse engineer your formula.

Again thanks
 
Upvote 0
You're welcome, glad it worked for you.

Cheers :beerchug:
 
Upvote 0
I must apologize STEMALO, there are times when I overthink the problem and solution, and not have had a good night sleep last night and my mind being a little "cloudy", this is definitely one of those times.

The solution can simply be:


Book1
ABC
15/6/2014 7:57:24 PM2014/06/05 19:57:24
2Custom Format C1
3yyyy/dd/mm hh:mm:ss
Sheet290
Cell Formulas
RangeFormula
C1=A1+0
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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