If its this 1 from Chergh then its starts with 1 for start and end dates equal, like networkdays in Excel as I stated or asked earlier, so you need to adjust your days, but why 540mins your days are 480, another 60 to find.
Brian
The penny dropped whilst gardening yesterday, myguess from wayback is correct but the statement above not quite. If the function returns an inclusive day count , which I believe it does, then starting and finishing on the same day will action case 1 thus times from 12 - 1 pm will give 17:00-12:00=5hrs and 13:00-08:00 =5hrs Total 600 minutes instead of 60, this principle will apply to all, also all other calculations will be out.
I was thrown by the fact that Mr Moe multiplies complete days by 480, obvoiusly allowing 1 hour for lunch? , but he also needs to do this on the first and last and only 1 day , ie 10am till 4 pm is not 6 but 5 hours, and starting before lunch on day 1 will will cost 1 hr as will finishing after lunch on the last day.
I leave Mr Moe to correct his code.
Brian