Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default Find the number of days in a month

Hi all
I've got to find the number of days in a month based on a date's month
number. thus, I tried the following array formula (which I am pretty sure is
not right):
=IF((MONTH(A14)={1,3,5,7,8,10,12}); 31; IF((MONTH(A14)={4,6,9,11}); 30;
IF((MONTH(A14)=2); 28; "Error"))) but it always gives me the only result:
"ERROR".
Your help will be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Find the number of days in a month

Try this

=DAY(DATE(YEAR(A14);MONTH(A14)+1;0))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"catrrmg" wrote in message
...
Hi all
I've got to find the number of days in a month based on a date's month
number. thus, I tried the following array formula (which I am pretty sure
is
not right):
=IF((MONTH(A14)={1,3,5,7,8,10,12}); 31; IF((MONTH(A14)={4,6,9,11}); 30;
IF((MONTH(A14)=2); 28; "Error"))) but it always gives me the only result:
"ERROR".
Your help will be much appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default Find the number of days in a month

Cheers mate

"Bob Phillips" wrote:

Try this

=DAY(DATE(YEAR(A14);MONTH(A14)+1;0))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"catrrmg" wrote in message
...
Hi all
I've got to find the number of days in a month based on a date's month
number. thus, I tried the following array formula (which I am pretty sure
is
not right):
=IF((MONTH(A14)={1,3,5,7,8,10,12}); 31; IF((MONTH(A14)={4,6,9,11}); 30;
IF((MONTH(A14)=2); 28; "Error"))) but it always gives me the only result:
"ERROR".
Your help will be much appreciated.




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
Finding the number of Days in the month? Will Excel Discussion (Misc queries) 1 April 13th 07 09:37 PM
Number of Days in the Month Beth Excel Discussion (Misc queries) 2 March 2nd 06 03:44 PM
Need help to reflect number of days in a month. Lewis Koh Excel Worksheet Functions 8 July 30th 05 01:14 AM
number of days in a month Ryan Proudfit Excel Worksheet Functions 8 April 7th 05 08:02 PM
Count number of days in given month? Bryan Excel Worksheet Functions 10 February 2nd 05 11:44 PM


All times are GMT +1. The time now is 12:13 PM.

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

About Us

"It's about Microsoft Excel"