![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 2
|
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.... Thanks in Advance, Sharon |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
One way: =DAY(DATE(YEAR(A2),MONTH(A2)+1,0)) where A2 house a date like the examples you provided. Aladin |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
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 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Quote:
=EDATE(A1,1)-A1 This assumes your date is in A1. Hope this helps, Russell |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|