ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   days in a month (https://www.excelbanter.com/excel-worksheet-functions/191265-days-month.html)

Nikhil

days in a month
 
Hi...

I wanted to know if there is a formula to calculate the no. of days in a
month...for eg. there are 30 days in Apr, 28/29 days in Feb....

if i have a date in one cell, e.g. 15-Apr-08, in the next cell, i want the
no. of days in Apr.. i.e 30 to appear in that cell...

how do i do it?

Thanks

Nikhil

Don Guillett

days in a month
 
One way
=DATE(YEAR(I4),MONTH(I4)+1,1)-DATE(YEAR(I4),MONTH(I4),1)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nikhil" wrote in message
...
Hi...

I wanted to know if there is a formula to calculate the no. of days in a
month...for eg. there are 30 days in Apr, 28/29 days in Feb....

if i have a date in one cell, e.g. 15-Apr-08, in the next cell, i want the
no. of days in Apr.. i.e 30 to appear in that cell...

how do i do it?

Thanks

Nikhil



Dave Peterson

days in a month
 
Another one:

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

The 0th day of the next month is the last day of the previous month.

And =day() just picks out that number.

Nikhil wrote:

Hi...

I wanted to know if there is a formula to calculate the no. of days in a
month...for eg. there are 30 days in Apr, 28/29 days in Feb....

if i have a date in one cell, e.g. 15-Apr-08, in the next cell, i want the
no. of days in Apr.. i.e 30 to appear in that cell...

how do i do it?

Thanks

Nikhil


--

Dave Peterson

T. Valko

days in a month
 
A couple mo

=32-DAY(A1-DAY(A1)+32)

If you're using a version of Excel prior to Excel 2007 and you have the
Analysis ToolPak add-in installed:

=DAY(EOMONTH(A1,0))

If you're using Excel 2007 (the ATP functions have been rolled into Excel
2007):

=DAY(EOMONTH(A1,0))



--
Biff
Microsoft Excel MVP


"Nikhil" wrote in message
...
Hi...

I wanted to know if there is a formula to calculate the no. of days in a
month...for eg. there are 30 days in Apr, 28/29 days in Feb....

if i have a date in one cell, e.g. 15-Apr-08, in the next cell, i want the
no. of days in Apr.. i.e 30 to appear in that cell...

how do i do it?

Thanks

Nikhil




Mike H

days in a month
 
And another but this one requires the analysis toolpak to be loaded

=DAY(EOMONTH(A1,0))

Mike

"Nikhil" wrote:

Hi...

I wanted to know if there is a formula to calculate the no. of days in a
month...for eg. there are 30 days in Apr, 28/29 days in Feb....

if i have a date in one cell, e.g. 15-Apr-08, in the next cell, i want the
no. of days in Apr.. i.e 30 to appear in that cell...

how do i do it?

Thanks

Nikhil



All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com