Counting Hours in a Schedule

mike4777

Board Regular
Joined
Apr 12, 2011
Messages
122
I was wondering if someone could help me develop a formula to count the hours when formatted in such a way:

NameHoursMondayTuesdayWednesdayThursday
Name 1=Formula8am-8pm10:30pm-6:15ametcetc
Name 2
Name 3
etc

<tbody>
</tbody>

I can do it with a million LEft( and Right( but that seems terribly clunky and prone to possible error.
 
Last edited:
btw, I moved the column out super far and it still displayed ##################################################################################################
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I tried this on another sheet and 12:00 am - 12:30 am with the first mod formula you gave me returns 23:30???
 
Upvote 0
It wasn't negative that I know of... though for some reason it is working now. I just don't know what to do with a formula that returns 23:30
 
Upvote 0
You can't upload attachments to the forum.

Check out this example on my OneDrive account:
http://1drv.ms/1pA952d

EDIT: The reason you're getting the pound signs (negative time values) is that you're taking the START time minus the END time. You need to take the END time minus the START time. Higher number minus the lower number. A value of 23:30 is 23 and a half hours. Like if you worked 8:00 AM until 7:30 AM the next day.
 
Upvote 0
I looked at your file but it doesn't really tell me anything different than what you already said. I formatted it similar. The formula I put in is returning 23:30
 
Upvote 0
Should the formula go into cell C4 (the highlighted cell)? And should it calculate for Saturday through Thursday?
 
Upvote 0
I amended your file. Here is the formula:

Code:
=IF(COUNTA(G4,I4)=2,(I4<=G4)+I4-G4,0)
+IF(COUNTA(J4,L4)=2,(L4<=J4)+L4-J4,0)
+IF(COUNTA(M4,O4)=2,(O4<=M4)+O4-M4,0)
+IF(COUNTA(P4,R4)=2,(R4<=P4)+R4-P4,0)
+IF(COUNTA(S4,U4)=2,(U4<=S4)+U4-S4,0)
+IF(COUNTA(V4,X4)=2,(X4<=V4)+X4-V4,0)

This checks if there is a start and end value in each cell, then calculates the difference. Output column (assumed to be your highlighted cell column) formatted as "[h]:mm". Is this what you're looking for?
 
Upvote 0

Forum statistics

Threads
1,215,167
Messages
6,123,401
Members
449,098
Latest member
ArturS75

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