Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default New Years Day formula?

This there a formula for calling up the first Monday if January 1st falls on
a weekend? Here's what I use now. It works fine as long as Jan 1st falls on a
Sunday but doesn't work if Jan 1st falls on a Saturday which is 2011.
=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),1),1,0,0,0,0,0,-1)
Thanks in Advance!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default New Years Day formula?

Richard,

I haven't tested this real thoroughly, but it seems to work:

=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),2),0,0,0,0,0,2,1)

--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"Richard" wrote in message
...
This there a formula for calling up the first Monday if January 1st falls
on
a weekend? Here's what I use now. It works fine as long as Jan 1st falls
on a
Sunday but doesn't work if Jan 1st falls on a Saturday which is 2011.
=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),1),1,0,0,0,0,0,-1)
Thanks in Advance!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default New Years Day formula?

Hi Richard

With your date in cell A1
=A1+(MAX(0,2-MOD(A1,7)))
seems to produce the result you want.

--
Regards

Roger Govier


"Richard" wrote in message
...
This there a formula for calling up the first Monday if January 1st
falls on
a weekend? Here's what I use now. It works fine as long as Jan 1st
falls on a
Sunday but doesn't work if Jan 1st falls on a Saturday which is 2011.
=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),1),1,0,0,0,0,0,-1)
Thanks in Advance!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default New Years Day formula?

Thanks so much, It works great. How the heck do you guys do it!!!!

"Earl Kiosterud" wrote:

Richard,

I haven't tested this real thoroughly, but it seems to work:

=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),2),0,0,0,0,0,2,1)

--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"Richard" wrote in message
...
This there a formula for calling up the first Monday if January 1st falls
on
a weekend? Here's what I use now. It works fine as long as Jan 1st falls
on a
Sunday but doesn't work if Jan 1st falls on a Saturday which is 2011.
=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1 ),1),1,0,0,0,0,0,-1)
Thanks in Advance!




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
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
How do i convert years to months (formula) SDPMIAMI Excel Worksheet Functions 1 June 17th 05 03:56 AM
how to calculate years, months by using one formula srinivasa rao Charts and Charting in Excel 2 April 15th 05 08:28 AM
how do i enter data for a # of years using a formula? en_kobe Excel Discussion (Misc queries) 0 February 10th 05 07:19 PM
how do i enter data for a # of years using a formula? enava Excel Discussion (Misc queries) 0 February 10th 05 07:17 PM


All times are GMT +1. The time now is 08:12 AM.

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

About Us

"It's about Microsoft Excel"