Formatting Text Data to Proper Date Format

claybwagner28

Board Regular
Joined
Sep 25, 2014
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hello, I downlaoded a source file which the dates are erronieuns typed in as text.
For example, Cell B4 has the following cell entry “Jan 7 2022” with the extra space, no comma and listed as general in format. Ultimately I am trying to change “Jan 7 2022” to “1/7/22”.
I tied to use TRIM but the file still reads it as text.

Any sugesstions? Thanks in advance!
Clay
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
If you use MDY format try
Excel Formula:
=TRIM(B4)+0
 
Upvote 0
If you use MDY format try
Excel Formula:
=TRIM(B4)+0
Thanks for the reply. I tried that and it gives me a #VALUE error. I may try to use CLEAN or copy and paste but there are thousnads of records.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Will update my account details. The subscription says Version 2112.

I ran =ISTEXT(B4) and it comes back true.
 
Upvote 0
2112 is the build number, rather than the version, if you look at your account it should tell you the version towards the top
1641841689777.png
 
Upvote 0
Ok if you put this formula in another cell it will spill down & should look like this
+Fluff 1.xlsm
ABCD
1
2
3
4Jan 7 202274
597
6110
732
832
955
1032
1150
1248
1350
1450
Main
Cell Formulas
RangeFormula
D4:D14D4=CODE(MID(B4,SEQUENCE(LEN(B4)),1))
Dynamic array formulas.


What values do you get, especially the 4th & 5th values
 
Upvote 0
Probably not the best way but if the Date value is text the below formula should work.

=DATE(RIGHT(TRIM(B4),4),MONTH(DATEVALUE(LEFT(TRIM(B4),3)&" 1, 2022")),MID(TRIM(B4),5,1))
 
Upvote 0
Almost there. It cuts off the day for 2 digits. For example “Dec 30 2021” returns 12/3/21. Gotta love governement provided data (Covid Cases)
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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