ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   dynamic dates (https://www.excelbanter.com/excel-worksheet-functions/46194-dynamic-dates.html)

BorisS

dynamic dates
 
I'd like to figure out a clever way to build a dynamic date heading row. I
need to enter the first month (1st of the month) and have the following
columns all be the 1st of the subsequent month. I know I can just add 31,
but that does't get me precisely to the 1st each time. I know I can do
date() using the previous column's data and adding 1 to month, but then I
have to IF for the case that I am hopping from December to Jan. Any other
way that is a function I don't know about?
--
Boris

Anne Troy

Put 1/1/05 into A1, then put this in A2: =DATE(YEAR(A1), MONTH(A1)+1,
DAY(A1))
************
Anne Troy
www.OfficeArticles.com

"BorisS" wrote in message
...
I'd like to figure out a clever way to build a dynamic date heading row.
I
need to enter the first month (1st of the month) and have the following
columns all be the 1st of the subsequent month. I know I can just add
31,
but that does't get me precisely to the 1st each time. I know I can do
date() using the previous column's data and adding 1 to month, but then I
have to IF for the case that I am hopping from December to Jan. Any other
way that is a function I don't know about?
--
Boris




Myrna Larson

Put the first date in, say, A1. In B1 use this formula =EOMONTH(A1,0)+1 and
copy to the right. EOMONTH is part of the Analysis Tool Pack.

Your last point re going from Dec to Jan isn't really a problem. This formula
will still work, with the first date in A1, =DATE(YEAR(A1),MONTH(A1)+1,1).
That's because the 13th month of 2005 is January, 2006.



On Mon, 19 Sep 2005 14:11:07 -0700, BorisS
wrote:

I'd like to figure out a clever way to build a dynamic date heading row. I
need to enter the first month (1st of the month) and have the following
columns all be the 1st of the subsequent month. I know I can just add 31,
but that does't get me precisely to the 1st each time. I know I can do
date() using the previous column's data and adding 1 to month, but then I
have to IF for the case that I am hopping from December to Jan. Any other
way that is a function I don't know about?



All times are GMT +1. The time now is 08:19 PM.

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