Understanding formula

  • Thread starter Thread starter Dig
  • Start date Start date
D

Dig

What exactly does this formula do

=DATE(YEAR(O2)-1,1,1)

I am trying to get it to print 2008

Any help appreciated
Thanks
 
hi
the date formula has 3 parts.
year, month and day in that order and is usually written...
=date(year(a1),month(a1),day(a1))
to evaulate a date in A2 but it can be written
=date(2008,7,3) which would be 7/3/08
the formula you posted...
=DATE(YEAR(O2)-1,1,1)
year(O2-1) subtracts 1 year form the date in O2 the puts month 1 and day1 so
if O2 contained today date the formula would read 1/1/2007
if you just want to print the year, use this
=year(O2)

regards
FSt1
 
Back
Top