Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Maybe:-
=DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1) Mike "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 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Or just:
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0)) The zeroth day of the month is the last day of the previous month. Mike H wrote: Maybe:- =DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1) Mike "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 -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number of days in month counted from shortened name of month & yea | Excel Worksheet Functions | |||
How to calculate a date: first day of the month after 60 days | Excel Discussion (Misc queries) | |||
Calculate Days in a Month | Excel Discussion (Misc queries) | |||
Calculate running target by days in the month | Excel Worksheet Functions | |||
number of days in a month | Excel Worksheet Functions |