#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default find date

I have a 'holiday' sheet with input holiday as follows:
23 Dec 2006
24 Dec 2006
25 Dec 2006
26 Dec 2006

My example is
If I type in 22 Dec. 2006 in cell A1. As 22 Dec 2006 is not fall on holiday,
the cell A1 shows 22 Dec. 2006 (remain unchange).
If I type in 23 Dec. 2006, the A2 cell will show 27 Dec 2006.

Is there any macro that could assist me to do this.

Thank you for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default find date

Since the number of holidays is fairly small and probably only gets updated
annually, I'd create a table where the first column is the holiday and the
second column is the next workday. Then coverting from a given date (say in
A1) to the next workday is a pretty simple formula. If the table on the
worksheet Holidays, in columns A:B, the formula is
=if(isna(match(a1,Holidays!A:A,false)),a1,vlookup( a1,Holidays!A:B,2,false))
That is, if the date in question is not a holiday, no change; otherwise,
return the corresponding date from column B.
HTH. --Bruce

"Anna" wrote:

I have a 'holiday' sheet with input holiday as follows:
23 Dec 2006
24 Dec 2006
25 Dec 2006
26 Dec 2006

My example is
If I type in 22 Dec. 2006 in cell A1. As 22 Dec 2006 is not fall on holiday,
the cell A1 shows 22 Dec. 2006 (remain unchange).
If I type in 23 Dec. 2006, the A2 cell will show 27 Dec 2006.

Is there any macro that could assist me to do this.

Thank you for your help

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
Find Specific date in Biwwekly Based on date jlclyde Excel Discussion (Misc queries) 3 January 27th 09 09:15 PM
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Find the date of the coming up Saturday given the current date. Michael Ermino Excel Worksheet Functions 4 April 11th 07 02:48 AM
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
Find date and copy range based on that date avzundert Excel Programming 2 November 25th 04 10:31 AM


All times are GMT +1. The time now is 10:06 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"