Friday, August 24, 2012

Excel - Date Formulas

Excel is not very user friendly when he need work with dates, however there are simple functions which allow us to work with them, see some samples below.

Please remember to adjust the cells/range references to your excel book



  • Define the number of days within a month:

Let's take November 2010 as an example;


=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))

The result will be 30 of course...


  • Get the first day of the month:

This function may be useful if you want to do a reference to a Month but have "Raw Data" with diferent days...

Let's take the date of 25 November 2012 as an example;

=(DATE(YEAR(A1),MONTH(A1),1)

The result will be 01/11/2010 and if you "custom" format to mmm-yy it will be displayed Nov-10 in your cells