Formula needed (Convert Date)

ironsides

Well-known Member
Joined
Aug 12, 2002
Messages
575
In adjacent cell I need to convert
12/16/2017 to read 171216 or
1/4/2017 to read 170104
 
Last edited:

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,633
If your dates are real Excel dates (that is, numbers), then try this:

=TEXT(A1,"yymmdd")
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,569
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">16-Dec-17</td><td style="text-align: right;;">171216</td><td style="text-align: right;;">171216</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">4-Jan-17</td><td style="text-align: right;;">170104</td><td style="text-align: right;;">170104</td></tr></tbody></table><p style="width:1.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">1e</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B2</th><td style="text-align:left">=A2</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">C2</th><td style="text-align:left">=TEXT(<font color="Blue">A2,"yymmdd"</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B3</th><td style="text-align:left">=A3</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">C3</th><td style="text-align:left">=TEXT(<font color="Blue">A3,"yymmdd"</font>)</td></tr></tbody></table></td></tr></table><br />

A2 is a real date not text
Custom format B2 yymmdd
 
Last edited:

ironsides

Well-known Member
Joined
Aug 12, 2002
Messages
575
Tetra201 Dave Patton thank you both. I tried Tetra first and it worked well Matt
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,633

ADVERTISEMENT

You are welcome.
 

foxtrapperscott

New Member
Joined
Oct 4, 2008
Messages
31
Hello, I am needing to do just the opposite. I need to change text 20170101 to reflect 01/01/2017. Any help would be greatly appreciated! Thanks
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,633

ADVERTISEMENT

Hello, I am needing to do just the opposite. I need to change text 20170101 to reflect 01/01/2017. Any help would be greatly appreciated! Thanks
The following formula will give you a real Excel date -- format it any way you like:

=--TEXT(--A1,"#-00-00")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,964
Messages
5,599,071
Members
414,281
Latest member
Engjamal2021

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
Top