Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default any way to tell the last day of the month? when the month is a var?


ie, if a a1 has 10/9/6 as a date, then month will give me the numeric month
into say a2, need to now how to find 31 into a3 or
" 4/6/6 "
30 "

thanks.

jim


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default any way to tell the last day of the month? when the month is a var


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

will give last day of month

HTH

"jim sturtz" wrote:


ie, if a a1 has 10/9/6 as a date, then month will give me the numeric month
into say a2, need to now how to find 31 into a3 or
" 4/6/6 "
30 "

thanks.

jim



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default any way to tell the last day of the month? when the month is a var

Several ways

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

or with Analysis Toolpak

=DAY(EOMONTH(A1,0))

or my favorite for unintelligibility!

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



"jim sturtz" wrote:


ie, if a a1 has 10/9/6 as a date, then month will give me the numeric month
into say a2, need to now how to find 31 into a3 or
" 4/6/6 "
30 "

thanks.

jim



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default any way to tell the last day of the month? when the month is a var?

On Mon, 9 Oct 2006 11:31:47 -0400, "jim sturtz" wrote:


ie, if a a1 has 10/9/6 as a date, then month will give me the numeric month
into say a2, need to now how to find 31 into a3 or
" 4/6/6 "
30 "

thanks.

jim


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

will give the date of the last day of the month that is in A1.

If you want only the day number, then:

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

or

for the date:
=DATE(YEAR(A1),MONTH(A1)+1,0)

for just the day:

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


--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default any way to tell the last day of the month? when the month is a var?

thanks alot for the quick replies


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
How to create a rolling 6 month average? anley Excel Discussion (Misc queries) 3 August 14th 06 12:41 PM
recognizing dates past End of Month sk81222 Excel Discussion (Misc queries) 6 June 14th 06 03:43 PM
Working days left in the month compared to previous months qwopzxnm Excel Worksheet Functions 8 October 24th 05 08:00 PM
formula: First and last day in month Zbigniew Lewandowski Excel Worksheet Functions 6 October 16th 05 04:51 AM
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 07:43 PM


All times are GMT +1. The time now is 11:26 AM.

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"