Back

About MrExcel
Consulting Services
Learn Excel Resources
Challenge of the Month
MrExcel Seminars

Message Board

MrExcel Store
Podcast
Search
Contact
Home

 

 

Past Tip of the Day

 

Dan asks I keep having a problem converting numbers into dates...I have the date 19960105 for example, but excel doesn't recognize it as a date without me having to put two slashes into it (i.e. 1996/01/05)...Is there any formula that I can use that will prevent me from having to put in all those slashes?

One option is to use an event handler, somewhat like the military time tip at http://www.mrexcel.com/tip029.shtml. Another method would be a formula. The Date() function allows you to specify a date by giving the Year, Month, Day. The following formula with parse your value and convert it to a date:

=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))

By Bill Jelen on 07-Nov-2001

MrExcel.com Consulting can be hired to implement this concept, or many other cool applications, with your data.

MrExcel.com provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.

 

Excel is a registered trademark of the Microsoft® Corporation.

All contents Copyright 1998-2008 by MrExcel Consulting.