ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   any way to tell the last day of the month? when the month is a var? (https://www.excelbanter.com/excel-worksheet-functions/113479-any-way-tell-last-day-month-when-month-var.html)

jim sturtz

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



Toppers

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




daddylonglegs

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




Ron Rosenfeld

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

jim sturtz

any way to tell the last day of the month? when the month is a var?
 
thanks alot for the quick replies




All times are GMT +1. The time now is 04:26 PM.

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