![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 13
|
I need to add one month at a time to a date list but with the months being different number of days I can't just add a number (eg 30) to the date above. I need the list to read eg...1/1/02, 2/1/02, 3/1/02, etc
|
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=EDATE(A1,1) [ requires the Analysis Toolpak, an add-in ] or =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)) |
|
|
|
|
|
|
#3 | |
|
Board Regular
Join Date: Apr 2002
Posts: 113
|
Quote:
|
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
This is just for fun (demented, I know)
The poor man's edate (will be wrong 3 days every four years). =DATE(YEAR(A1),MONTH(A1)+1,MIN(DAY(A1),VLOOKUP(MONTH(A1)+1,{13,31;2,28;3,31;4,30;5,31;6,30;7,31;8,31;9,30;10,31;11,30;12 ,31},2,0))) Okay, here is the fix until, I believe the year 4000 =DATE(YEAR(B2),MONTH(B2)+1,MIN(DAY(B2),VLOOKUP(MONTH(B2)+1,{13,31;2,28;3,31;4,30;5,31;6,30;7,31;8,31;9,30;10,31;11,30;12 ,31},2,0))+((MONTH(B2)=1)*(MOD(YEAR(B2),4)=0)*(DAY(B2)>28))) [ This Message was edited by: iml on 2002-04-10 12:20 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|