LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Month and year programmatically in a cell?

"StargateFan" wrote in message
...
On Sat, 26 Nov 2005 15:58:42 -0600, AH·C
wrote:


Aha, then what you want is the following in each "mmmm yyyy" cell:

January 2005
=DATE(YEAR(TODAY()),*1*,1)

February 2005
=DATE(YEAR(TODAY()),*2*,1)

......

December 2005
=DATE(YEAR(TODAY()),*12*,1)


(Here at work the other msgs didn't come through in this thread. Hoping
these msgs get out okay.)

Yup, tried it here at work on my copy here and same thing - I get a formula
error. But I went to the groups via google and googled using the formula
above for January 2005 and I read through the messages that came up. I've
found something that works. I hope it'll work always so going to show what
I got that seems to be going the trick.

Formatting the cells involved to be "mmmm yyyy", by putting the following
formulas in the cells, I get the results listed:

=DATE(YEAR(TODAY()), MONTH(TODAY())-11,1) returns January 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-10,1) returns February 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-9,1) returns March 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-8,1) returns April 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-7,1) returns May 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-6,1) returns June 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-5,1) returns July 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-4,1) returns August 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-3,1) returns September 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-2,1) returns October 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-1,1) returns November 2005
=DATE(YEAR(TODAY()), MONTH(TODAY())-0,1) returns December 2005

I'll just have to check in the new year, which is not so very far away, to
see if the cells still display the correct info. So far, so good, however.

I couldn't have done it without the initial code. That led me to this page
he
http://groups.google.ca/group/micros...d5b0c3f35d9515
which had a formula similar to what I used above.

Thanks! :oD


 
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
Combine month day and year from separate columns in to one cell Thanks, JH Excel Discussion (Misc queries) 4 April 3rd 23 04:42 PM
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
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM
how can I highlight a cell if it meets year and month criteria Clyde Excel Worksheet Functions 2 May 11th 06 02:24 PM
Dates of a Day for a month & year cell formulas mikeburg Excel Discussion (Misc queries) 2 December 29th 05 10:14 PM


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

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"