Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Advance A Date By Month Or Year

Greetings,

I have three cells. The first (A1) has a month listing and the
second (B1) has a year listing. I have CommandButtons to change the
months and the years, just not the code to make them work.

Any help would be appreciated.

TIA

-Minitman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Advance A Date By Month Or Year

Minitman wrote:
I have three cells. The first (A1) has a month listing and the
second (B1) has a year listing. I have CommandButtons to change the
months and the years, just not the code to make them work.


Is your question what to do with months 12?:
NewYear = OldYear + AddYears + (OldMonth + AddMonths-1) \ 12
NewMonth = 1 + (OldMonth + AddMonths - 1) mod 12
or, if you've already got the old..+add..= new..
NewYear = NewYear + (NewMonth-1) \ 12
NewMonth = 1 + (NewMonth - 1) mod 12



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Advance A Date By Month Or Year

Thanks Dave,

I appreciate the reply, but that's not what I was looking for. It
turns out all I needed was to look deeper into the TEXT() command and
I came up with this where E3 is the date entry cell:

=TEXT(E3+30, "mmm")&" 20, "&TEXT(E3+30, "yyyy")

-Minitman


On Sun, 16 Jan 2005 20:39:32 -0800, Dave D-C
wrote:

Minitman wrote:
I have three cells. The first (A1) has a month listing and the
second (B1) has a year listing. I have CommandButtons to change the
months and the years, just not the code to make them work.


Is your question what to do with months 12?:
NewYear = OldYear + AddYears + (OldMonth + AddMonths-1) \ 12
NewMonth = 1 + (OldMonth + AddMonths - 1) mod 12
or, if you've already got the old..+add..= new..
NewYear = NewYear + (NewMonth-1) \ 12
NewMonth = 1 + (NewMonth - 1) mod 12



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Advance A Date By Month Or Year

=Text(Date(year(e3),month(e3)+1,20),"mmm d, yyyy")

might be another way.

--
Regards,
Tom Ogilvy

"Minitman" wrote in message
...
Thanks Dave,

I appreciate the reply, but that's not what I was looking for. It
turns out all I needed was to look deeper into the TEXT() command and
I came up with this where E3 is the date entry cell:

=TEXT(E3+30, "mmm")&" 20, "&TEXT(E3+30, "yyyy")

-Minitman


On Sun, 16 Jan 2005 20:39:32 -0800, Dave D-C
wrote:

Minitman wrote:
I have three cells. The first (A1) has a month listing and the
second (B1) has a year listing. I have CommandButtons to change the
months and the years, just not the code to make them work.


Is your question what to do with months 12?:
NewYear = OldYear + AddYears + (OldMonth + AddMonths-1) \ 12
NewMonth = 1 + (OldMonth + AddMonths - 1) mod 12
or, if you've already got the old..+add..= new..
NewYear = NewYear + (NewMonth-1) \ 12
NewMonth = 1 + (NewMonth - 1) mod 12



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---




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
Date(Year,Month,Day) not returnign correct date jlclyde Excel Discussion (Misc queries) 8 October 16th 09 02:42 PM
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? misscrf Excel Discussion (Misc queries) 1 December 14th 07 02:59 PM
how to creat a formula to advance date by one year Liz Lalman Excel Worksheet Functions 3 January 18th 07 08:46 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"