Use the EOMONTH function to determine the last day of a month
To find the last day of a month, use the EOMONTH function: (EOMONTH(start_date, offset_months)).
This function returns the date of the last day of the month, offset_months from start_date. If you try to use this function and it doesn’t work, you may need to load the Analysis ToolPak add-in. In Excel 2003, Select Add-Ins… from the [...]