View Single Post
  #7   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 29 Jul 2005 08:52:20 -0500, Lewis Koh
wrote:


B1= 29/07/2005

B2=IF(MONTH(B1)=1,31,IF(MONTH(B1)=2,28,IF(MONTH(B 1)=3,31,IF(MONTH(B1)=4,30,IF(MONTH(B1)=5,31,IF(MON TH(B1)=6,30,IF(MONTH(B1)=7,30,B3)))))))

B3=IF(MONTH(B1)=8,31,IF(MONTH(B1)=9,30,IF(MONTH(B 1)=10,31,IF(MONTH(B1)=11,30,31))))

I wanted to get the number of days from B1 but I can't seems to join B2
and B3 together. Is this a limitation in excel? Is there a better way to
get the number of days from the month itself?


And another approach, that does not require the Analysis Tool Pak:

=32-DAY(B1-DAY(B1)+32)

(Format the result as General or Number)


--ron