I’ve searched for such functin in standard excel Date and Time functions but haven’t found anything. 1 minute of googling and very clear and short answer was foun in Understanding Nothing blog:
If a date is written in a cell A8 then the formula is
=DATE(YEAR(A8), MONTH(A8)+1, 0)
Shortly, this means that we are getting the date of 0th day of the next month or saying in peoples’ language, the last day of given month.
Posted by jarik