The exact formula and process will depend on your requirements but the DATEDIFF Date Functions should help! Here's a sample idea:
1. Firs thing we need to consider is that leads may be created outside business hours, if that's the case, adjust the created data to the beginning or end of the business hours (move it to 8AM or 5PM).
2. For leads that were both created and assigned at the same day, calculate the number of minutes between them.
3. For leads that were created on one day, but assigned on another, calculate the number of minutes between them BUT subtract the number of non-business hours between those days. e.g. if 2 days have passed, multiply 2 times the number of non-business hours per day (16).
Putting that into calculated fields:
2 and 3
Hope this helps!