Rearrange general text and replace "/" with "-"

Nyx2012

New Member
Joined
May 18, 2023
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
Hey there, need some help with this one please, the below text is in general format and needs to stay that way.

01/06/2023 07:45:26 must be rearranged to 2023-06-01 07:45:26. there is a space between the date and time. would appreciate a formula, i have found this on the forum but it throws value
=(RIGHT(A2,4)&TEXT(LEFT(A2,LEN(A2)-4),"0000"))+0
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try this:
Excel Formula:
=TEXT(A2+0,"yyyy-mm-dd hh:mm:ss")
 
Upvote 0
Try this:
Excel Formula:
=TEXT(A2+0,"yyyy-mm-dd hh:mm:ss")
Im getting a #VALUE!
1689602431300.png
 
Upvote 0
Are you using a European version, or an American version of Excel?

Does "01/06/2023" mean "January 1, 2023" or "June 1, 2023"?

What does this formula return?
Excel Formula:
=ISNUMBER(A2)
 
Upvote 0
Let's take the date format out of the request:
Are you using a European version, or an American version of Excel?

Does "01/06/2023" mean "January 1, 2023" or "June 1, 2023"?

What does this formula return?
Excel Formula:
=ISNUMBER(A2)
Hi Joe,

I dont want it to be in a date format, if it is in a date format it causes problems with the system the file is uploaded to.

11/22/3333 44:55:66 must read as

3333-22-11 44:55:66
 
Upvote 0
I dont want it to be in a date format, if it is in a date format it causes problems with the system the file is uploaded to.
I understand. And my code will return a TEXT value, not a DATE value.

It works on my system, but I am using an American system.

Can you please answer the other two questions I asked? These are key in my trying to recreate your exact scenario and see if I can come up with a solution that works on your particular system.
Since I do not have access to your workbook, I am reliant on the information you provide to me.

 
Upvote 0
Okie dokie, I have figured it out

=MID(A2,7,4)&"-"&MID(A2,4,2)&"-"&LEFT(A2,2)&" "&RIGHT(A2,8)
 
Last edited:
Upvote 0
Okie dokie, I have figured it out

=RIGHT(A3,4)&"-"&MID(A3,4,2)&"-"&LEFT(A3,2)&" "&RIGHT(A2,8)
I don't see how that is possible because in your original question, and image follow up in post 3, "01/06/2023 07:45:26" all appears in one cell, but your solution references two cells (A2 and A3).
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,305
Members
449,095
Latest member
Chestertim

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