Time Calc

HappyChappy

Active Member
Joined
Jan 26, 2013
Messages
383
Office Version
  1. 2019
  2. 2010
  3. 2007
Platform
  1. Windows
c3 and d3 are start and finish times
e3=MROUND(C3,(1/24/60)*15)
f3=MROUND(D3,(1/24/60)*15)
g3=MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)
g3 gives me correct time worked but i want to be able to deduct 30 mins from the total any help with this one please
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try...
Excel Formula:
=MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00")
Format the cell as a time format
 
Upvote 0
Try...
Excel Formula:
=MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00")
Format the cell as a time format
it works but.... if the cells have no times entered eg 00:00 and 00:00 then it returns ############## can we get this removed
 
Upvote 0
Excel Formula:
=IF(OR(C3=0,D3=0),"",MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00"))
 
Upvote 0
Cell Formulas
RangeFormula
A3:A9A3=B3
E3:F9F3=MROUND(D3,(1/24/60)*15)
G3:G9G3=IF(OR(C3=0,D3=0),"",MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00"""))
F10F10=SUM(G3:G9)
G10G10=CONCATENATE(24*DAY(F10)+HOUR(F10),":",MINUTE(F10))
B4:B9B4=B3+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C3:D9Cell Value>0textNO
 
Upvote 0
Not the result that I get with the formula that I posted
Book1.xlsb
ABCDEFGH
1
2JuneHours WorkedTotal Hours
34507529/05/20230000 
44507630/05/20230000 
54507731/05/20230.250.6770830.250.67708309:45:00
64507801/06/20230.250.6979170.250.69791710:15:00
74507902/06/20230.250.6666670.250.66666709:30:00
84508003/06/20230000 
94508104/06/20230000 
101.22916729:30
11
12
13
14
15
Sheet2
Cell Formulas
RangeFormula
A3:A9A3=B3
E3:F9F3=MROUND(D3,(1/24/60)*15)
G3:G9G3=IF(OR(C3=0,D3=0),"",MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00"))
F10F10=SUM(G3:G9)
G10G10=CONCATENATE(24*DAY(F10)+HOUR(F10),":",MINUTE(F10))
B4:B9B4=B3+1
 
Upvote 0
Solution
noticed a typo in my copying of your formula to many speech marks

it works now
 
Upvote 0
Essex23.24.xlsx
ABCDEFG
1DayDateStart/Finish TimesRounded Time to nearest 15 MinRounded Time to nearest 15 MinHours Worked
2JuneHours WorkedTotal Hours
3Monday29/05/202300:0000:000:0000:00 
4Tuesday30/05/202300:0000:000:0000:00 
5Wednesday31/05/202306:0016:156:0016:159:45
6Thursday01/06/202306:0016:456:0016:4510:15
7Friday02/06/202306:0016:006:0016:009:30
8Saturday03/06/202300:0000:000:0000:00 
9Sunday04/06/202300:0000:000:0000:00 
1005:3029:30
June
Cell Formulas
RangeFormula
A3:A9A3=B3
E3:F9F3=MROUND(D3,(1/24/60)*15)
G3:G9G3=IF(OR(C3=0,D3=0),"",MEDIAN("05:00","23:00",IF(F3<E3,1+F3,F3))-MEDIAN("05:00","23:00",E3)-TIMEVALUE("00:30:00"))
F10F10=SUM(G3:G9)
G10G10=CONCATENATE(24*DAY(F10)+HOUR(F10),":",MINUTE(F10))
B4:B9B4=B3+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C3:D9Cell Value>0textNO
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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