Date formatting mmddyyyy to mm/dd/yyyy

techexpressinc

New Member
Joined
Apr 13, 2009
Messages
40
I tried all the normal formatting, they failed. My data - date field look like this now:

8032005
2272007
11222007

I need it to be

08/03/2005
etc.

Thx Russ
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
There's going to be multiple perspectives to accomplish this; here's one;


<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 71px"><COL style="WIDTH: 75px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; TEXT-ALIGN: right">8032005</TD><TD style="TEXT-ALIGN: right">08/03/2005</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; TEXT-ALIGN: right">2272007</TD><TD style="TEXT-ALIGN: right">02/27/2007</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; TEXT-ALIGN: right">11222007</TD><TD style="TEXT-ALIGN: right">11/22/2007</TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>B1</TD><TD>=DATEVALUE(CONCATENATE(LEFT(TEXT(A1,"00000000"),2),"/",MID(A1,LEN(A1)-5,2),"/",RIGHT(A1,4)))</TD></TR><TR><TD>B2</TD><TD>=DATEVALUE(CONCATENATE(LEFT(TEXT(A2,"00000000"),2),"/",MID(A2,LEN(A2)-5,2),"/",RIGHT(A2,4)))</TD></TR><TR><TD>B3</TD><TD>=DATEVALUE(CONCATENATE(LEFT(TEXT(A3,"00000000"),2),"/",MID(A3,LEN(A3)-5,2),"/",RIGHT(A3,4)))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Upvote 0
Try =--TEXT(A1, "00-00-0000") and format as you prefer.
 
Upvote 0
follow-up ftu

if the cell is empty - I need to skip doing the formula

=DATEVALUE(CONCATENATE(LEFT(TEXT(G2,"00000000"),2),"/",MID(G2,LEN(G2)-5,2),"/",RIGHT(G2,4)))

The worksheet had blanks for a batch of rows
then have date i.e. 1282010

I do not want a batch of #error - so I did this and it worked!

=IF(G2="","",DATEVALUE(CONCATENATE(LEFT(TEXT(G2,"00000000"),2),"/",MID(G2,LEN(G2)-5,2),"/",RIGHT(G2,4)))

Thx for the helping hand. Rus
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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