Formula Help

R

Richard

If say January 1st falls on a Sunday but paid holiday is on the first
"weekday", which is Monday of 2006. How would you rewrite this formula for it
to reflect future changes year after year. This formula is what I'm using
now, which works fine as long as the dates don't fall on a weekend.
=Date(TheYear,1,1) I'd like to enter this formula as is but for it to
actually be =Date(TheYear,1,2) What this is? It's a calender that keeps track
of all the paid holidays, vacation time, meetings and such. Thanks in advance
 
D

daddylonglegs

This formula will give the date of the first Monday of a year shown in
A1

=DATE(A1,1,8)-WEEKDAY(DATE(A1,1,6))
 
B

bpeltzer

You didn't say what should happen if Jan 1 is a Saturday. Is Dec 31 the
holiday? If that's the case then:
=DATE(TheYear,1,1)+CHOOSE(WEEKDAY(DATE(TheYear,1,1),1),1,0,0,0,0,0,-1)
should do. It figures out what day of the week is Jan 1 then uses the
choose function to add one for Sunday and subtract one for Saturday. You can
adjust the list of values (1,0,0,...,-1) if that assumption is wrong for your
firm.
 
D

daddylonglegs

Sorry, I see you want first weekday of the year. You could do that wit
WORKDAY function from Analysis ToolPak

=WORKDAY(DATE(A1,1,0),1)

format as date

again where A1 contains the yea
 
D

Don Guillett

try this
=DATE(2006,1,1)+8-WEEKDAY(DATE(2006,1,1),2)
for TheYear to be the current year
=DATE(year(today()),1,1)+8-WEEKDAY(DATE(year(today()),1,1),2)
 

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