New Years Day formula?

R

Richard

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!
 
E

Earl Kiosterud

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)
 
R

Roger Govier

Hi Richard

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top