Math and Date question

# Thread: Math and Date question

1. Senior Member
Join Date
Dec 1969
Posts
583

## Math and Date question

How would I go about getting the range, median, mode, and modal of a set of dates?<BR><BR>Thanks,<BR>Conrad

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## I'd convert them all to days...

...since some starting date. And then they are just integer numbers.<BR><BR>Conveniently, if you do<BR><BR>&#060;%<BR>someDate = #13 Jan 1986#<BR><BR>numDays = CLNG( someDate )<BR>%&#062;<BR><BR>you will find that numDays *IS* an integer number of days since a canonical starting date. Happens to be 30 DEC 1899 (so 1 Jan 1900 is day 2, for example) for starting point, but what does that matter? <BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## Oh...and then when you get...

...an answer, as an integer, you can convert it back to a date via simply<BR><BR>&#060;%<BR>answerDate = CDATE( someInteger )<BR>%&#062;<BR><BR>

4. Member
Join Date
Dec 1969
Posts
69

## RE: Math and Date question

What is the Modal? Do you mean "mean"? Be careful. If you also need the variance, it is not a linear measure, so it is senisitive to the encoding you use for the date. For instance, if you want it in days, you can use the dates as days, but if you want it in years, you need to divide the result by 365.2425 * 365.2425, not just by 365 once... All of these other measures are linear, and so they don&#039;t depend on what encoding you&#039;re using for the date.<BR><BR>Kelly

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## Actually...

...for dates between 3/1/1900 and 2/28/2000 you can (and maybe should) just use 365.25 instead of 365.2425. Yeah, I know that doesn&#039;t give you astronomical years, but it gives you "bank years", which presumably is the point of something like this?<BR><BR>

6. Member
Join Date
Dec 1969
Posts
69

## RE: Actually...

Maybe. If we&#039;re on the topic of financial years, there are several different styles of years in the financial world. 360, 365, 365.25, 364 (52 weeks), etc.<BR><BR>Kelly

7. Senior Member
Join Date
Dec 1969
Posts
96,118

## Heh! We'll get him so confused...

...he&#039;ll be dayzed. [sic, of course]<BR><BR>

8. Senior Member
Join Date
Dec 1969
Posts
583

## Thanks

Thanks for your help guys. You made my life so much easier today!<BR><BR>In a way of thanks:<BR><BR>http://homepage.mac.com/starshipexeter/<BR><BR>Thanks again!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•