Change date format on import

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Good morning

I am importing some data and I am having two different issues in col. B.
In rows 3 this data says Nov-9 (the 9th of November) when I try to change the format it will say November 2009.
Is there any manipulation that can be done to correct this format?

Second issue
In lines 12/13 is a combination of the date January 2, 2021 - I have tried to Concatenate the two but the data then is not seen as a date - is there a better way? - ultimately I need it to read 02-Jan-21.

Many thanks for your assistance in advance.
Stephen

1593036369132.png
 
note in this string =DATE(RIGHT(B5,4),MONTH(1&LEFT(B5,3)),MID(B5,5,1)) there is no refernce to the data in cell B6 which holds the calendar year?
"
The following suggestion looks the same as your example; the data is in merged cells.

That formula was a guess. One possibility was that you were using merged cells.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
No the cells are separate when they import - Jan2 in one cell 2022 in the cell below.
Thanks
Stephen
 
Upvote 0
Hi Dave

This sheet is imported from an online timetable.
The data in row B says general.
My Windows settings (Australia) is day month year.
The required format will be dd-mmm-yy in the sheet

I did enter your two =text strings into C13 c&d and got a #VALUE! response

I attempted to attach the spreadsheet but realised the forum doesn't allow this.

Thanks again
Stephen

Hi Stephen,

You can upload the sample sheet on cloud storage like google drive or dropbox and share with us the download link.

Best Regards
M. Yusuf
 
Upvote 0
Hi Stephen,

This issue is that there is a space after 2021 is cell b13
please use the below slightly modified formula

=TEXT(DATE(LEFT(B13,4),MONTH(DATEVALUE(LEFT(B12,3)&" 1, 2020")),MID(B12,5,1)),"dd-mmm-yy")

Regards
M. Yusuf
 
Upvote 0
Hi Mamady
I have resaved the file to show I have pasted the string into the adjacent cell.
I am getting the #VALUE! error message.

With thanks
Stephen
 
Upvote 0
Hi Stephen,

Not sure why you are still getting error. But you can find the file with the same formula in the following link without any error


Regards
M. Yusuf
 
Upvote 0
Many thanks I can now see that - I will investigate my end to see why this has caused such a problem - I thank you and all that have assisted.
Regards
Stephen
 
Upvote 0
There is an extraneous character in cell B13.
Try =Len(B13) the result is 5!!

Try this formula

=DATE(LEFT(B13,4),MONTH(1&LEFT(B12,3)),MID(B12,5,1))

Then format the cell to your preference.

If all of the dates are 2021, the following would work
=DATE(2021,MONTH(1&LEFT(B12,3)),MID(B12,5,1))
 
Last edited:
Upvote 0
The check for extraneous characters would have shown which cell has the problem.
Excel's Formula Evaluation showed the contents of B13 had a space at the end "2013 ".

=DATE(LEFT(B13,4),MONTH(LEFT(B12,3)&1),MID(B12,5,1)) also works.

Unless you need the cell to be Text, do not convert to text; just format or custom format to your preference.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

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