View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
ARGT ARGT is offline
external usenet poster
 
Posts: 15
Default Determining a leap year

I want to calculate a daily interest rate from an annual rate. I have input
the following formula into a cell labelled "Days in the Current Year" :
"=IF(OR(MOD(TODAY(),400)=0,AND(MOD(TODAY(),4)=0,MO D(TODAY(),100)<0)),366,
365)

This, I think, is supposed to return 366 if the IF condition is True,
otherwise it returns 365. This number is then used in other calculations.

However, the reverse seems to happen. For example, 2008 (as the current year
and taken from the "Today" formula I had assumed) should have returned A
"True" for the IF statement and hence 366. But it returns 365.

Obviously doing something wrong! Is my assumption that the Today statement
weill return the current year correct? Is the IF statement correct?

Many thanks for any advice.