Formula to count days between 2 dates/times excluding weekends but including only partial days depending on when the date/time falls (see description)

Status
Not open for further replies.

freeb1893

Board Regular
Joined
Jul 30, 2012
Messages
234
Office Version
  1. 365
Platform
  1. Windows
I’d to take 2 date/times and calculate the time between them

I’d like to exclude counting weekends

I’d like to count partial days based on a custom start time and custom end time that I define in reference cells, and it’s what is considered 1 day

For example, I’d like to set my start time of a day in cell G1, and my end time of a day in cell H1. In G1 I set my start time of a day as 8:00AM, in H1 I set my end time of a day as 5:00PM

For my start dates, I want to count 1 full day as 8:00AM to 5:00PM that day (defined and adjustable in my reference cells of G1 and H1). If the start time happens to be 7:00AM, I still only count time from 8:00AM through 5:00PM that day. If the start time happens to be after 5:00PM, I don’t want to count any time for that day in my result. Same logic for my end dates. If the end time is before my 8:00AM reference in cell G1, I don’t want to count any time on my end date. If my end time is after 5:00PM, I only want to count time between 8:00AM to 5:00PM as defined in my reference cells as 1.00 days.

I also may have 2 dates/times that don’t have weekends between them. I also may have 2 dates/times that have multiple weekends between them that I don’t want to count in my day/time result. I also may have 2 dates/times that are just a matter of minutes or hours within a single day.

Anyone know how to put this into a formula? Thanks in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Please continue in the thread linked above. This one closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top