ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula Help (https://www.excelbanter.com/excel-discussion-misc-queries/98009-formula-help.html)

Richard

Formula Help
 
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

daddylonglegs

Formula Help
 

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


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=559275


bpeltzer

Formula Help
 
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.

"Richard" wrote:

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


daddylonglegs

Formula Help
 

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

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

format as date

again where A1 contains the year


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=559275


Don Guillett

Formula Help
 
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)
--
Don Guillett
SalesAid Software

"Richard" wrote in message
...
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





All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com