View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default Calculate Number of Days in a Month

=DAY(EOMONTH(A1,0))

Required ATP add-ins


"Gary T" wrote:

Hi

I want to be able to use a formula to calculate the number of days in a
month based on a date in question - e.g.

in A1 I enter a date (e.g. 21 November 2007)

in A2 I want to put a formula that will tell me, based on what I have
entered into A1, how many days that month has (e.g. based on what I put in A1
- 21 November 2007, the formula would return 30).

I also need this to account for leap years.

Regards