Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 219
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 219
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Date for Sorting KP Excel Discussion (Misc queries) 2 September 18th 06 05:10 PM
Sorting by date [email protected] Excel Discussion (Misc queries) 7 June 17th 06 01:06 PM
Pivot Table - Sorting on Sum field and filterin [email protected] Excel Discussion (Misc queries) 0 May 30th 06 11:07 AM
Date & Time Field Diane Walker Excel Discussion (Misc queries) 2 January 10th 06 03:30 PM
sorting date " MMM-YY" (Jan-05) GEORGIA Excel Discussion (Misc queries) 8 June 23rd 05 01:30 PM


All times are GMT +1. The time now is 06:34 PM.

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

About Us

"It's about Microsoft Excel"