Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
sorting on a date field
I have a date field with dates ranging from the 1850s through to 1930 with
dd/mm/yyyy I know about xdate - to handle dates before 1900 Is it possible to sort on this field successfully ? If so, how ? Bob M |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
sorting on a date field
Using John Walkenbach's XDate concept, use...
'/=======================================/ Public Function XDateSerial(Select_Cell As Range) As Double Application.Volatile On Error Resume Next XDateSerial = DateValue(Select_Cell) * 1 End Function '/=======================================/ Cell A1 = 10/12/1930 - Cell B1=XDateSerial(A1) = 11243 Cell A2 = 10/12/1850 - Cell B2=XDateSerial(A2) = -17976 This makes it easy to sort the date range. HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Bob Matthews" wrote: I have a date field with dates ranging from the 1850s through to 1930 with dd/mm/yyyy I know about xdate - to handle dates before 1900 Is it possible to sort on this field successfully ? If so, how ? Bob M |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
sorting on a date field
Using John Wlakenbach's examples...
'/================================================== =========/ Public Function XDateSerial(Select_Cell As Range) As Double Application.Volatile On Error Resume Next XDateSerial = DateValue(Select_Cell) * 1 End Function '/================================================== =========/ A1 = 10/15/1930 A2 = 10/15/1850 B1 = XDateSerial(A1) evaluates to 11243 B2 = XDateSerial(A2) evaluates to -17976 Now, it's easy to sort by 'date'. HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Bob Matthews" wrote: I have a date field with dates ranging from the 1850s through to 1930 with dd/mm/yyyy I know about xdate - to handle dates before 1900 Is it possible to sort on this field successfully ? If so, how ? Bob M |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formatting Date for Sorting | Excel Discussion (Misc queries) | |||
Sorting by date | Excel Discussion (Misc queries) | |||
Pivot Table - Sorting on Sum field and filterin | Excel Discussion (Misc queries) | |||
Date & Time Field | Excel Discussion (Misc queries) | |||
sorting date " MMM-YY" (Jan-05) | Excel Discussion (Misc queries) |