![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: BobH
Posts: 7
|
I want to enter a numeric date (61592) and have Excel convert it to (06/15/92). I've selected the cells and used the Format/Cells and Date selection, however, when I enter the numeric date, Excel converts it to some new date and present it with in the mm/dd/yy format. How can I turn off this conversion, or enter the numeric data so I can do the formatting?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
See http://www.mrexcel.com/board/viewtop...c=6233&forum=2.
Keep in mind that Excel has it's own internal date values that are recognized and properly displayed by Excel's built-in date formats. See the Excel Help Index topic for "How Microsoft Excel performs date and time calculations" [ This Message was edited by: Mark W. on 2002-04-24 16:27 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Location: BobH
Posts: 7
|
A friend provided a solution to this problem. The solution is: Select column for all cells, or select cell.
Select FORMAT, CELLS, NUMBER, CUSTOM. In the "type" area key in the following mask: 0#"/"##"/"## Hit enter to enter this mask. The cells in the column have now been formatted and the user can enter numeric data that will be automatically formatted with the slashes (mm/dd/yy). No conversion will take place. |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Macon, Georgia USA
Posts: 124
|
try this:
=(left(a1,1+(len(a1)>5))&"/"&mid(a1,2+(len(a1)>5),2)&"/"&right(a1,2))+0 or =date(1900+right(a1,2),left(a1,1+(len(a1)>5)),mid(a1,2+(len(a1)>5),2)) I got this from someplace I cannot remember right now, but i hope this help. Walter Never stop learning |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
=TEXT(A1,"0-00-0000")+0 ...will suffice! [ This Message was edited by: Mark W. on 2002-04-26 12:33 ] |
|
|
|
|
|
|
#7 |
|
New Member
Join Date: Apr 2002
Location: BobH
Posts: 7
|
I tried to use your simplified formatting formula, but could not get it to work. Excel returned errors. Thanks for trying to help.
|
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
To make a string of text into dates, you can also use the date function which takes the year, month, and day as arguments. So say I have a text string '06152002 in cell A1, where 06 represents month, 15 represents the day, and 2002 represents the year, then =DATE(right(A1,4),left(a1,2),mid(A1,3,2)) will truly convert that text string into DATE for Excel. _________________ Yogi Anand Edit: Deleted inactive web site reference from hard code signature line [ This Message was edited by: Yogi Anand on 2003-01-19 17:16 ] |
|
|
|
|
|
|
#9 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
=TEXT(A1,"0-00-00")+0 [ This Message was edited by: Mark W. on 2002-05-12 12:12 ] |
|
|
|
|
|
|
#10 | ||
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
With the two digit year representation, caution regarding the cutoff year of 29 still applies (year numbers 29 or less will be in the 2000 series, and 30 or above will be considered in the 1900 series). It is interesting that conversion of text strings using your formula works with the '-' character but not with the '/' character, although generally Excel will accept date with either of the two characters. Any toughts on that! Regards |
||
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|