![]() |
Formatting the Date in Excel
Is there any way in Excel that I can format the Date so I don't have to type
any slashes between the month and day? In other words, I would like to be able to type in 0714 press "enter" and have excel recognize that this is 07/14/2005 without typing in 07/14. Any suggestions would be appreciated. Thanks, |
Short of writing code, you could enter your numerics only date in cell
A1, for instance: 07142005. Then in B1 write a formula: =mid(A1,1,2)&"/"&mid(A1,3,2)&"/"&left(A1,4) Then you could copy column B and paste as values into their required spot. |
Hi,
Excel will treat those values as numerics. The following formula could be used =DATE(YEAR(NOW()),IF(LEN(A1)=3,LEFT(A1,1),IF(LEN(A 1)=4,LEFT(A1,2),NA())),RIGHT(A1,2)) You would have to ensure that the day portion was always 2 digits with this eg enter 0701 and not 071 for 1st July. The formula assumes you mean the current year (as defined on your system). Also, it doesn't check if the month is 12 or below or for the max number of days for the month. HTH Matt "JD" wrote: Is there any way in Excel that I can format the Date so I don't have to type any slashes between the month and day? In other words, I would like to be able to type in 0714 press "enter" and have excel recognize that this is 07/14/2005 without typing in 07/14. Any suggestions would be appreciated. Thanks, |
JD
Chip Pearson has code for this. http://www.cpearson.com/excel/DateTimeEntry.htm Gord Dibben Excel MVP On Thu, 14 Jul 2005 13:04:02 -0700, "JD" wrote: Is there any way in Excel that I can format the Date so I don't have to type any slashes between the month and day? In other words, I would like to be able to type in 0714 press "enter" and have excel recognize that this is 07/14/2005 without typing in 07/14. Any suggestions would be appreciated. Thanks, |
All times are GMT +1. The time now is 10:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com