Change date format on import

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
365
Platform
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
 

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

mamady

Board Regular
Joined
Sep 23, 2011
Messages
75
Office Version
365
Platform
Windows
Hi Stephen,

With regards to the first issue, assuming it is 2019, please try the following formula:
=TEXT(DATE(2019,MONTH(B3),RIGHT(YEAR(B3),2)),"dd-mmm")

With regards to the second issue, try the following formula:
=TEXT(DATE(B13,MONTH(B12),DAY(B12)),"dd-mmm-yy")

Best Regards
M. Yusuf
 

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
365
Platform
Windows
Hi Stephen,

With regards to the first issue, assuming it is 2019, please try the following formula:
=TEXT(DATE(2019,MONTH(B3),RIGHT(YEAR(B3),2)),"dd-mmm")

With regards to the second issue, try the following formula:
=TEXT(DATE(B13,MONTH(B12),DAY(B12)),"dd-mmm-yy")

Best Regards
M. Yusuf

Mamady
Many thanks for your reply - I got the first string working straight away but having problems with number 2. - Can you reconfirm?
Thank you
Stephen
 

mamady

Board Regular
Joined
Sep 23, 2011
Messages
75
Office Version
365
Platform
Windows
Hi Stephen,

What is the format of cells B12 and B13? A date, number or a text?

Best Regards
M. Yusuf
 

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
365
Platform
Windows
Hi Mamady - General
 

mamady

Board Regular
Joined
Sep 23, 2011
Messages
75
Office Version
365
Platform
Windows
In that case, try the following:

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

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,046
Office Version
2010
Platform
Windows
format the date to your preference

T202006b.xlsm
BC
12Jan 2
132021
02-Jan-21
14
3a
Cell Formulas
RangeFormula
C13C13=DATE(B13,MONTH(1&LEFT(B12,3)),RIGHT(B12,1))
 

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
365
Platform
Windows
Dave - I tried your suggestion and this is the response
1593384869790.png



This is the suggestion from Mamady from the previous post

1593384957182.png


Any suggestions would be appreciated - thanks again - Stephen
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,046
Office Version
2010
Platform
Windows
What is your date format? What is the date setting in Windows Regional settings?

What part of the formula is creating the error?

I did not notice the comma; try the following

T202006b.xlsm
BCD
12Jan 2,
132021
02-Jan-21
02-Jan-21
14
3a
Cell Formulas
RangeFormula
C13C13=DATE(B13,MONTH(1&LEFT(B12,3)),MID(B12,5,1))
D13D13=(B13&"-"&MONTH(1&LEFT(B12,3))&"-"&MID(B12,5,1))+0
 

namloop

New Member
Joined
Mar 23, 2020
Messages
23
Office Version
365
Platform
Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,100,039
Messages
5,472,121
Members
406,805
Latest member
AlesD6

This Week's Hot Topics

Top