Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 331
Default MLK b-day as holiday date

hi,

i need a function to calculate what date would be the 3rd monday in January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default MLK b-day as holiday date

Try this...

=DATE(A1,1,22)-WEEKDAY(DATE(A1,1,6))

The general formula is:

=DATE(year,month,1+N*7)-WEEKDAY(DATE(year,month,8-day_of_week))

Whe

N = the nth weekday (3 for the 3rd Monday)

day_of_week = a number from 1 to 7. 1 = Sunday thru 7 = Saturday

--
Biff
Microsoft Excel MVP


"Greg" wrote in message
...
hi,

i need a function to calculate what date would be the 3rd monday in
January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default MLK b-day as holiday date

Left out the critical piece of information!

Try this...
=DATE(A1,1,22)-WEEKDAY(DATE(A1,1,6))


A1 holds the year number of interest. For example, 2011.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try this...

=DATE(A1,1,22)-WEEKDAY(DATE(A1,1,6))

The general formula is:

=DATE(year,month,1+N*7)-WEEKDAY(DATE(year,month,8-day_of_week))

Whe

N = the nth weekday (3 for the 3rd Monday)

day_of_week = a number from 1 to 7. 1 = Sunday thru 7 = Saturday

--
Biff
Microsoft Excel MVP


"Greg" wrote in message
...
hi,

i need a function to calculate what date would be the 3rd monday in
January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default MLK b-day as holiday date

Hi,

try this where a1 contains any properly formatted date.

=A1-DAY(A1)+CHOOSE(WEEKDAY(A1-DAY(A1)),22,21,20,19,18,17,23)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Greg" wrote:

hi,

i need a function to calculate what date would be the 3rd monday in January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default MLK b-day as holiday date

Biff,

Never seen that method before, very neat but I bet you meant:-

=DATE(A1,1,21)-WEEKDAY(DATE(A1,1,6))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"T. Valko" wrote:

Try this...

=DATE(A1,1,22)-WEEKDAY(DATE(A1,1,6))

The general formula is:

=DATE(year,month,1+N*7)-WEEKDAY(DATE(year,month,8-day_of_week))

Whe

N = the nth weekday (3 for the 3rd Monday)

day_of_week = a number from 1 to 7. 1 = Sunday thru 7 = Saturday

--
Biff
Microsoft Excel MVP


"Greg" wrote in message
...
hi,

i need a function to calculate what date would be the 3rd monday in
January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg



.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default MLK b-day as holiday date

Biff,

Apologies, i understand your formula now.

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike H" wrote:

Biff,

Never seen that method before, very neat but I bet you meant:-

=DATE(A1,1,21)-WEEKDAY(DATE(A1,1,6))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"T. Valko" wrote:

Try this...

=DATE(A1,1,22)-WEEKDAY(DATE(A1,1,6))

The general formula is:

=DATE(year,month,1+N*7)-WEEKDAY(DATE(year,month,8-day_of_week))

Whe

N = the nth weekday (3 for the 3rd Monday)

day_of_week = a number from 1 to 7. 1 = Sunday thru 7 = Saturday

--
Biff
Microsoft Excel MVP


"Greg" wrote in message
...
hi,

i need a function to calculate what date would be the 3rd monday in
January
for a given year. can this be done w/o arrays?

thanks

--
______
Regards,
Greg



.

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
Formula to check if a date is a holiday Dave Excel Discussion (Misc queries) 5 September 16th 08 01:21 AM
Auto holiday date population Johnny Excel Discussion (Misc queries) 0 April 10th 08 04:08 PM
Invalid date if weekend or bank holiday grobertson Excel Worksheet Functions 7 June 14th 07 03:24 PM
Project future date w/ 6 day work week and holiday damucol Excel Discussion (Misc queries) 3 February 8th 07 02:41 PM
Holiday Planner show holiday taken? Mac5 Excel Worksheet Functions 0 July 18th 06 11:29 PM


All times are GMT +1. The time now is 12:36 PM.

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"