ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Understanding formula (https://www.excelbanter.com/excel-worksheet-functions/193600-understanding-formula.html)

Dig

Understanding formula
 
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

FSt1

Understanding formula
 
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

"Dig" wrote:

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



All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com