Date Time Functions MSOfficeExcel 2007 Tutorial

Input the formula: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))