A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date formatting for sorting - followup



 
 
Thread Tools Display Modes
  #1  
Old May 3rd, 2009, 06:15 PM posted to microsoft.public.excel.newusers
- Butch[_2_]
external usenet poster
 
Posts: 3
Default Date formatting for sorting - followup

I tried formatting with a created "Custom" format of "yyyy-mm-dd" and
that works EXCEPT, it doesn't affect dates before 1900. Why wouldn't it,
and how can I get it to affect all dates?


  #2  
Old May 3rd, 2009, 06:53 PM posted to microsoft.public.excel.newusers
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Date formatting for sorting - followup

Excel doesn't like dates before 1900.

So those entries that look like dates (but are before 1900) aren't really dates.

You may be able to use:

=if(isnumber(a1),text(a1,"yyyymmdd"),someotherexpr ession)

But that other expression would depend on how those text entries looked.

Some combination of =mid(), =right() and/or =left() may do it for you.

12/25/1850
could be
=IF(ISNUMBER(A1),TEXT(A1,"yyyymmdd"),MID(A1,7,4)&L EFT(A1,2)&MID(A1,4,2))


- Butch wrote:

I tried formatting with a created "Custom" format of "yyyy-mm-dd" and
that works EXCEPT, it doesn't affect dates before 1900. Why wouldn't it,
and how can I get it to affect all dates?


--

Dave Peterson
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.