# Problem calculating dates

#### Flash0220

##### Board Regular
Hello,

I'm having the following problem.

I have a (Excel Office 2003) spreadsheet, containing the following
information.

On a sheet called "Invoerscherm" (sorry, that's dutch) I have a column G
which contains the following formula :
=VERT.ZOEKEN(C168;Variabelen!\$B\$5:\$E\$20;2;ONWAAR)+E168

This formula calculates a date, on this date our company has to take
some kind of action such as calling a customer or sending them a letter.

But the problem is that sometimes the formula calculates a date which
is an official holliday like christmas, easter or other day's like that.

Since our company is closed on these dates the call or letter to be sent has to be done on a workday before that particular calculated date.

So if the calculated date is december 25th 2006 (Chrismas) then
the formula has to be modified in some way, that friday december 22nd 2006 is calculated instead of december 25th.

If the calculated date is december 26th 2006 (Also christmas), the same
date (december 22nd) has to be calculated.
Both christmas day's and the weekend are holidays, so these dates should
not be generated by the (modified) formula.

I already have a list with official dutch holidays defined in range A7:A47
on a sheet (tab) called "Feestdagen".

Is there a way to modify the formula mentioned above, to do this ?

Best regards,

Frits Jager
The Netherlands

### Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

#### GlennUK

##### Well-known Member
The Analysis Toolpak has a function called Workday, which can accept a list of holidays. Do you have access to that?

#### Andrew Poulsom

##### MrExcel MVP
You can use the WORKDAY function. It's in the Analysis ToolPak Add-In.

#### barry houdini

##### MrExcel MVP
It would look something like

=WORKDAY(VERT.ZOEKEN(C168;Variabelen!\$B\$5:\$E\$20;2;ONWAAR)+E168+1;-1;Feestdagen!\$A\$7:\$A\$47)

#### sweater_vests_rock

##### Well-known Member
frits.

one option would be to add to check to see if the date returned is on your list of holiday dates. if it is, replace that date with the adjusted date (which i'll assume is in B7:B47 on 'Feestdagen'). using your christmas example,

Code:
``=IF(COUNTIF(Feestdagen!\$A\$7:\$A\$47,VERT.ZOEKEN(Invoerchem!C168;Variabelen!\$B\$5:\$E\$20;2;ONWAAR)+Invoerchem!E168)>0, VLOOKUP(VERT.ZOEKEN(Invoerchem!C168;Variabelen!\$B\$5:\$E\$20;2;ONWAAR)+Invoerchem!E168, Feestdagen!\$A\$7:\$B\$47, 2, FALSE)``

i can't test this, unfortunately, but it should get you most the way there.

cheers. ben.

#### Flash0220

##### Board Regular
Hello,

The formula "=WORKDAY(VERT.ZOEKEN(C168;Variabelen!\$B\$5:\$E\$20;2;ONWAAR)+E168+1;-1;Feestdagen!\$A\$7:\$A\$47)" worked perfectly !
Thanks !

Best regards,

Frits Jager
The Netherlands

Replies
15
Views
1K
Replies
4
Views
148
Replies
6
Views
888
Replies
1
Views
989
Replies
0
Views
226

1,171,060
Messages
5,873,537
Members
432,982
Latest member
meepio

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back