Thanks:  0
Likes:  0

# Thread: How to calculate days in the month

1. Hi,

I would like to find a function that can calculate the number of days in the month for a given date that is provided in the following format dd/mm/yy.

For example 23/02/02, would result in 28.
23/02/04, would result in 29.
31/01/01, would result in 31.
etc....

Sharon

2. On 2002-03-11 21:03, shanmer wrote:
Hi,

I would like to find a function that can calculate the number of days in the month for a given date that is provided in the following format dd/mm/yy.

For example 23/02/02, would result in 28.
23/02/04, would result in 29.
31/01/01, would result in 31.
etc....

Sharon
Sharon,

One way:

=DAY(DATE(YEAR(A2),MONTH(A2)+1,0))

where A2 house a date like the examples you provided.

3. Looks like Alladin beat me to it just
as I was about to post

Just to add to that format the cell as
general....

Ivan

4. On 2002-03-11 21:03, shanmer wrote:
Hi,

I would like to find a function that can calculate the number of days in the month for a given date that is provided in the following format dd/mm/yy.

For example 23/02/02, would result in 28.
23/02/04, would result in 29.
31/01/01, would result in 31.
etc....

Sharon
If you have the Analysis ToolPpak add-in installed (Tools-Add-ins, Analysis ToolPak if you don't), you can use the following formula:

=EDATE(A1,1)-A1

This assumes your date is in A1.

Hope this helps,

Russell

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•