Forum Discussion
Calculate total working hours between date/time excluding weekends and break time
- 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.
HansVogelaarHi thanks for responding, I changed the input but the result is still wrong, and it can't exclude lunch break.
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?
- HansVogelaarJul 15, 2024MVP
Open both my sample workbook and your workbook.
Press Alt+F11 to activate the Visual Basic Editor.
In the Project Explorer pane on the left hand side, expand TimeDifferenceWithBreak.xlsm, and Modules under it if necessary.
Drag Module1 to your workbook and drop it there.
Switch back to Excel.
Save your workbook as a macro-enabled workbook (*.xlsm)
- VladLockhartJul 16, 2024Copper ContributorHi thanks, I did as u told me. But how do I use it, how do I call function on the column i want? I'm really sorry I'm new to this.