#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Days in a month

Hi there,

Am looking a formulae that would return the number of days for a given month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default Days in a month

Hi,

Use following formula :

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

HTH
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Days in a month

Try one of these:

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

If you have the Analysis ToolPak add-in installed:

=DAY(EOMONTH(A1,0))

If the date you enter is *always* the 1st of the month:

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


--
Biff
Microsoft Excel MVP


"Sena" wrote in message
...
Hi there,

Am looking a formulae that would return the number of days for a given
month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Days in a month

Here is one way to get the value...

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

Rick


"Sena" wrote in message
...
Hi there,

Am looking a formulae that would return the number of days for a given
month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Days in a month

Ignore mine... the first 0 should have been YEAR(A1) as the others have
posted.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Here is one way to get the value...

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

Rick


"Sena" wrote in message
...
Hi there,

Am looking a formulae that would return the number of days for a given
month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Days in a month

You need the year otherwise it'll always calculate based on Excel's
interpretation that 1900 was a leap year.

A1 = 2/1/2008

=29

A1 = 2/1/2007

=29

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Here is one way to get the value...

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

Rick


"Sena" wrote in message
...
Hi there,

Am looking a formulae that would return the number of days for a given
month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Days in a month

Yep... as I am sure you have seen by now, my second posting and yours
crossed in transit.

Rick


"T. Valko" wrote in message
...
You need the year otherwise it'll always calculate based on Excel's
interpretation that 1900 was a leap year.

A1 = 2/1/2008

=29

A1 = 2/1/2007

=29

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Here is one way to get the value...

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

Rick


"Sena" wrote in message
...
Hi there,

Am looking a formulae that would return the number of days for a given
month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks
--
Cheers !





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Days in a month

On Sat, 5 Jan 2008 22:27:00 -0800, Sena wrote:

Hi there,

Am looking a formulae that would return the number of days for a given month.

eg :
A1 = 1/1/07 ( meaning Jan )
A2 = need the number of days in Jan (result - 31)

B1 = 1/11/07 ( meaning Nov )
B2 = need the number of days in Nov (result -30)

Thanks


If you have the Analysis Tool Pak installed, or are using Excel 2007, you can
try:

=DAY(EOMONTH(A1,0))


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of days in month counted from shortened name of month & yea Tumar Excel Worksheet Functions 6 September 18th 07 03:36 PM
Days per month for calculating storage days Bart Excel Worksheet Functions 3 January 31st 07 06:40 PM
function to fill all days of month to end of month Monique Excel Worksheet Functions 11 May 1st 06 07:39 PM
function to fill all days of month to end of month YaHootie Excel Worksheet Functions 10 May 1st 06 06:01 AM
Dates - Several Days In a month to month only Andy_Pimp Excel Discussion (Misc queries) 1 February 28th 06 11:11 AM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"