ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find date (https://www.excelbanter.com/excel-programming/357161-find-date.html)

Anna

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

bpeltzer

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



All times are GMT +1. The time now is 07:21 PM.

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