Understanding formula

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
 
F

FSt1

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top