Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I need a function or formula that will return the number of days in a month.
I saw it in one of my reference books, but I'll probably never find it again. Please help. -- Ryan Proudfit |
#2
![]() |
|||
|
|||
![]()
=DAYS(EOMONTH( target date,0))
to use EOMONTH() you must have the Analysis toolpack add-in loaded To get the same answer without the Analysis toolpack =DAY(Date(year(target date), month( target date)+1, 1)-1) Duke "Ryan Proudfit" wrote: I need a function or formula that will return the number of days in a month. I saw it in one of my reference books, but I'll probably never find it again. Please help. -- Ryan Proudfit |
#3
![]() |
|||
|
|||
![]()
Hi
"Duke Carey" wrote in message ... =DAYS(EOMONTH( target date,0)) to use EOMONTH() you must have the Analysis toolpack add-in loaded To get the same answer without the Analysis toolpack =DAY(Date(year(target date), month( target date)+1, 1)-1) Somewhat shorter version: =DAY(Date(year(target date), month( target date)+1, 0)) Arvi Laanemets |
#4
![]() |
|||
|
|||
![]()
Ryan,
The following formula will return the number of days in the current month. =DAY(DATE(YEAR(NOW()),MONTH(NOW())+1,0)) It works because the 0th day of one month is the last day of the prior month. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ryan Proudfit" wrote in message ... I need a function or formula that will return the number of days in a month. I saw it in one of my reference books, but I'll probably never find it again. Please help. -- Ryan Proudfit |
#5
![]() |
|||
|
|||
![]()
On Thu, 7 Apr 2005 10:17:04 -0700, "Ryan Proudfit"
wrote: I need a function or formula that will return the number of days in a month. I saw it in one of my reference books, but I'll probably never find it again. Please help. Given any date in a month in A1, the number of days in that month is: =32-DAY(A1-DAY(A1)+32) --ron |
#6
![]() |
|||
|
|||
![]()
I tried both ways and still get an error. All I'm doing is substituting a
cell reference in the target date portion of the formula. What the heck am I doing wrong? Ryan :\ "Duke Carey" wrote: =DAYS(EOMONTH( target date,0)) to use EOMONTH() you must have the Analysis toolpack add-in loaded To get the same answer without the Analysis toolpack =DAY(Date(year(target date), month( target date)+1, 1)-1) Duke "Ryan Proudfit" wrote: I need a function or formula that will return the number of days in a month. I saw it in one of my reference books, but I'll probably never find it again. Please help. -- Ryan Proudfit |
#7
![]() |
|||
|
|||
![]()
That's a new one on me., Arvi. Live and learn (and learn, and learn)
"Arvi Laanemets" wrote: Hi "Duke Carey" wrote in message ... =DAYS(EOMONTH( target date,0)) to use EOMONTH() you must have the Analysis toolpack add-in loaded To get the same answer without the Analysis toolpack =DAY(Date(year(target date), month( target date)+1, 1)-1) Somewhat shorter version: =DAY(Date(year(target date), month( target date)+1, 0)) Arvi Laanemets |
#8
![]() |
|||
|
|||
![]()
Hi
Are you sure you have a date in cell, not a datestring. When you format the cell with date as general, does it change to number? When not, then you have to convert it, or to modify the formula so it works with datestring. Arvi Laanemets "Ryan Proudfit" wrote in message ... I tried both ways and still get an error. All I'm doing is substituting a cell reference in the target date portion of the formula. What the heck am I doing wrong? Ryan :\ "Duke Carey" wrote: =DAYS(EOMONTH( target date,0)) to use EOMONTH() you must have the Analysis toolpack add-in loaded To get the same answer without the Analysis toolpack =DAY(Date(year(target date), month( target date)+1, 1)-1) Duke "Ryan Proudfit" wrote: I need a function or formula that will return the number of days in a month. I saw it in one of my reference books, but I'll probably never find it again. Please help. -- Ryan Proudfit |
#9
![]() |
|||
|
|||
![]()
"Arvi Laanemets" wrote in message
... Somewhat shorter version: =DAY(Date(year(target date), month( target date)+1, 0)) and if you can guarantee that target date will never be later than the 28th then =DAY(A14+32-DAY(A14+32)) is shorter still, otherwise =DAY(A14-DAY(A14)+32-DAY(A14-DAY(A14)+32)) Sandy -- to e-mail direct replace @mailinator.com with @tiscali.co.uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HELP - need to returns the current number of past month this year and ... | Excel Worksheet Functions | |||
how do i display the total number of days in the current month in. | Excel Discussion (Misc queries) | |||
Calculating the number of Fridays in a month | Excel Worksheet Functions | |||
Count number of days in given month? | Excel Worksheet Functions | |||
How to extract month number from month name | Excel Discussion (Misc queries) |