Link to home
Start Free TrialLog in
Avatar of ahannah
ahannah

asked on

Outlook Custom Forms - date calculation

Hi,

I have created a custom form based on Contacts in Outlook 2003. It has 2 fileds, a rexceived and responded date/time. I want to calculate the lapsed time in hours but I want to EXCLUDE weekends and bank holidays. The formula below is fine to calculate the elapsed house but how would I exclude weekends/holidays Thnks very musc. Andy

IIf(DateDiff("h",[Date Received],[Respond Date])<0,"In Progress",DateDiff("h",[Date Received],[Respond Date]))
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, Andy.

Use a nested IIF.  Something like this

IIf(Weekday(Date) <> vbSaturday And Weekday(Date) <> vbSunday,Code_for_Weekdays, Code_for_Weekends)
Avatar of ahannah
ahannah

ASKER

Hi BlueDevil fan,

Still not clear how this would exclude the weekends from the date calculation

Andy
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ahannah

ASKER

Thanks a lot, it worked.
You're welcome.