![]() |
![]() |
|
|||||||
| 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 |
|
Board Regular
Join Date: Apr 2002
Location: Palo Alto, CA
Posts: 75
|
I've got a column with several thousand rows of dates that I want to sort from earliest to most recent. The text is in the form mm/dd/yy but the data was imported from another source and formatted as Numbers. In other words, they look like dates, but don't act like dates. No matter how I format them (as numbers or dates), the order gets messed up when I sort them. Any ideas?
Thanks in advance. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
G'day,
copy a 0 in a cell (or a blank cell), select the range of dates, then do an edit/paste special/add. Reformat the cells with a date format. Adam |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
You can coerce all your apparent dates into true dates,by
first clicking on a cell with 0 value, then EDIT|COPY then highlite the apparent date set and EDIT|PASTE_Special|operation Add then sort _________________ 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:13 ] |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Is it not rather the opposite?
If =ISNUMBER(a-date-cell) gives FALSE, select the column range that looks like date... activate Data|Text to Columns. |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Palo Alto, CA
Posts: 75
|
Thanks to all of you. I tried both methods (adding zeros and text to columns) and they both seem to work.
I understand why adding zero ultimately works --- it seems to turn the cell into a true number. But why does Excel allow users to add anything to something that looks like 4/12/95 ??? And I don't have a clue why the text-to-columns method works. Just curious. Thanks again. |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
Excel coerces numeric items that may be presentable as text into true numbers, by addition of 0, or you can accomplish the same thing by multiplying with 1 key in ="4/12/95"+0 in a cell and the "4/12/95" date which was a text string comes to life as true date And I don't have a clue why the text-to-columns method works. when you use the Text to Column conversion, Excel looks at items like "4/12/95" and believes you would want to convert them into Number general format or Date format, and it proceeds on that basis -- you could optionally have Excel consider these as text strings if you wanted to. Hope This Helps Regards! [ This Message was edited by: Yogi Anand on 2002-05-14 10:47 ] |
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Apr 2002
Location: Palo Alto, CA
Posts: 75
|
Makes sense. Thanx.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|