Posted to microsoft.public.excel.worksheet.functions
|
|
I need a february 29th row, but only if the day of year actuallyexists
On May 22, 8:01*am, Archimedes' Lever
wrote:
On Fri, 22 May 2009 08:39:29 +0100, Simon Lloyd
wrote:
FatBytestard;354132 Wrote:
On Thu, 21 May 2009 16:58:24 +0100, Simon Lloyd
wrote:
Simon Lloyd;352847 Wrote:
I have to admit, i believed the year 2100 was a leap year, as i
thought
2008 was a leap year, taking a look at year 2096 shows February to
have
29 days, and as it happens every 4 years i would have assumed that
2100
was a leap year, i live in the UK if that makes a difference :),
aside
from that i assume that the year given was just an example to prove
a
formula.It bugged me a bit and guess what 2100 isn't a leap
year...my apologies,
not that i worked it out rather that i went here 'Leap Year
Calculator'
('Leap Year Calculator'
(http://www.dataip.co.uk/Reference/LeapYear.php))
OK. That web page has a java script, but he describes what is needed.
So I need to resolve whether a math result is a whole number.
What is the basic function text for that?
I have to test a given number for divisibility by 4, then by 100, then
by 400.
I only need one test to construct the other two, but what string?
IfIsInterger? function, or is there a test function that only returns
true if the number is a whole number?Here's a function, supplied by RoyUk (a moderator at The Code Cage and
has his own site 'www.excel-it.com'(http://www.excel-it.com)) that
should suit your needs.
Code:
--------------------
* *Option Explicit
*Function LeapYear(year As Integer) As Boolean
*If (Month(DateSerial(year, 2, 29)) = 2) Then
*LeapYear = True
*Else: LeapYear = False
*End If
*End Function
--------------------
* Yes. *When I entered 2/29 for this year into a cell, it came back as
3/01. *I figured it was something simple like that.
* Thanks.- Hide quoted text -
- Show quoted text -
FAGGOT
I AM PROTEUS
|