Formula To Get The Number Of Days In The Month
The other way I know is:
=DAY(EOMONTH(NOW(),0))
Please note that this formula will only for Excel 2007 onwards. For Excel 2003 you can use only the first formula (or move to the newer version of Excel :-)).
Further reading: How to calculate monthly payment? How to Create Rolling 6 Months Average? How to Format Date and Time? Turning Off the Automatic Formatting of Dates
Template
You can download the Template here – Download
Further reading: Basic concepts Getting started with Excel Cell References