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
 
Do you now have the correct dates for your very first question in post "#1.

What information is in the cell imported?
What result do you require?

If you require a formula to convert, please provide several examples and the expected results.
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Dave - thank you for your perseverance, I am learning more about Excel through people like you!
This has now remedied my issue.
Best regards
Stephen
 
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.
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))


Dave both of these worked. The only problem now is the samples I used were (days of the month ) 1-9. When the date is the 13th of Month there is an extra character and it throws it out.
I have attached a sample file here


Many thanks
Stephen
 
Upvote 0
=DATE(LEFT(C17,4),MONTH(LEFT(C16,3)&1),MID(C16,5,LEN(C16)-5))
 
Upvote 0
You could use Find and Replace to remove the extra character in the sheet.
The formula is then a little simpler.
I also included an alternative.

Test Sheet July 1.xlsx
CDE
2Feb 24,24-Jan-2124-Feb-21
32021
Sheet1
Cell Formulas
RangeFormula
D2D2=DATE(C3,MONTH(LEFT(C3&1)),MID(C2,5,LEN(C2)-5))
E2E2=--(MID(SUBSTITUTE(C2,",",""),5,2)&LEFT(SUBSTITUTE(C2,",",""),3)&C3)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

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