Need Help with Formula on Weekly Schedule

Megaduck

New Member
Joined
Jan 19, 2024
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I am working on a weekly schedule for my work. I have been trying my best to figure this out, trying different formula examples I found online, etc. I have had no luck so far.

To better help explain what I am trying to accomplish, I will post a picture of it:

Excel_Snip.PNG


In the image, you'll see the various schedules.

I am wanting to calculate the number of hours in yellow based on the information in the boxes above them, without doing so manually.

I was able to calculate time differences between say, 6 am and 2 pm. But then it doesn't account for when a person is off or when there's an overnight, third shift. When I use the same formula there, the calculate ends up a negative number.

If I type 6 am to 2 pm. I want it to input 8 hours below it. If I do 6 am to 6 pm, it will input 12. If I type OFF, I want to input 0.

I hope that makes sense.

Is this sort of thing even possible? Thanks so much!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the forum.
Does this work for you?

Book1
ABCDEFG
1WEEKLY SCHEDULE
219-Jan20-Jan21-Jan22-Jan23-Jan24-Jan25-Jan
3FRISATSUNMONTUEWEDTHU
46:306:006:006:006:00
514:00OFFOFF14:0014:0014:0014:00
67:300:000:008:008:008:008:00
714:0014:0014:0014:0014:00
822:00OFFOFF22:0022:0022:0022:00
98:000:000:008:008:008:008:00
1018:00
116:00
1212:00
Sheet2
Cell Formulas
RangeFormula
A6:G6,A12,A9:G9A6=IF(A5="OFF",0,MOD(A5-A4,1))
 
Upvote 0
Thanks so much. This is more or less what I am looking for, except I would like for the result to be a whole number vs. time.

So instead of 8:00, it would be 8. How would I go about that?
 
Upvote 0
Never mind, I figured that part out. I just multiplied by 24.

=IF(A5="OFF",0,MOD(A5-A4,1)*24)

That worked perfectly. Thank you!!
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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