Ideas to convert Text to a date

Zandor435

New Member
Joined
Oct 13, 2016
Messages
16
Data comes out of my database formatted as follows with just the year and month.

201804 for April, 2018 or 201805 for May, 2018.

Also, the date is a number stored as text.

I am trying to group that date in a pivot table but unable to without quite a bit of manipulation.

Currently I am using text to columns and the joining the data back but this takes quite a few steps.

Can anyone suggest a faster or more efficient way to accomplish what I’m trying to do?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
If possible, edit the import to show true date.




Excel 2010
BC
12018041-Apr-18
22018051-May-18
3
4c
Cell Formulas
RangeFormula
C1=DATE(LEFT(B1,4),RIGHT(B1,2),1)
 
Last edited:
Upvote 0
Put this formula in a cell and format the cell with the date display format you want...

=0+TEXT(A1,"0000-00-\01")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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