Forum Discussion
VladLockhart
Jul 15, 2024Copper Contributor
Calculate total working hours between date/time excluding weekends and break time
Hello, I want to calculate the hours between two fields, but I just want a simple number of hours. No concatenated labels, not days, just accumulated hours and I need it to exclude weekends and...
- Jul 15, 2024
I attached the wrong version, sorry.
The 2 hours in the first example is because the 1st of May is in the holiday list. If you remove that date from the holiday list, you get 3 hours.
See the attached version.
HansVogelaar
Jul 15, 2024MVP
Here is a solution using a custom VBA function.
- VladLockhartJul 15, 2024Copper Contributor
HansVogelaarHi thanks for responding, I changed the input but the result is still wrong, and it can't exclude lunch break.
- HansVogelaarJul 15, 2024MVP
I attached the wrong version, sorry.
The 2 hours in the first example is because the 1st of May is in the holiday list. If you remove that date from the holiday list, you get 3 hours.
See the attached version.
- VladLockhartJul 15, 2024Copper Contributor
HansVogelaar thanks dude it seems working just fine. But I can't copy it to my existing excel data. It always shows #NAME? can u help with that?