MROUND and time cards

sideabeef

New Member
Joined
Mar 22, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
=MROUND(IF((OR(B13="",D13="")),0,IF((D13<B13),((D13-B13)*24)+24,(D13-B13)*24)-C13/60),1/60)
this is the line i use to calculate total hours at work.
if i have a starting time (B13) of 8:55 am and a break (C13) of 30 minutes and an end time (D13) of 5:33 pm
right now that calculation gives me a time out put of 8.13 hours but the problem is i get paid by the quarter hour.
how do i get the calculation to round the 8:55 am and the 5:33 pm to the nearest 15 minutes before it finds the difference and reports in (F13) a time of 8 hours rounded to the quarter hour.
when all said and done i need (B13) and (D13) to still show the time i entered but the total in (F13) needs to be the difference of a rounded (B13) and (D13) in a quarter hour format.

time-card-calculator_biweekly.xlsx
ABCDEFGHIJK
11Day of WeekTime InBreaks (minutes)Time OutTotal HrsRegular HrsOvertime HrsSick HrsHoliday HrsVacation Hrs
13Mon 1-28:55 AM305:33 PM8.138.000.13
14Tue 1-39:05 AM305:45 PM8.178.000.17
15Wed 1-49:00 AM456:30 PM8.758.000.75
16Thu 1-59:00 AM456:30 PM8.758.000.75
17Fri 1-69:00 AM404:45 PM7.087.080.00
18Sat 1-78:00 AM010:00 AM2.000.921.08
19Sun 1-80.000.000.00
20Total Hrs:40.002.880.000.000.00
Biweekly
Cell Formulas
RangeFormula
F13:F19F13=MROUND(IF((OR(B13="",D13="")),0,IF((D13<B13),((D13-B13)*24)+24,(D13-B13)*24)-C13/60),1/60)
G13:G19G13=F13-H13
H13H13=MAX(IF($W$8,MAX(0,SUM(G12:G$12)+F13-$V$9),0),IF($W$6,IF(F13>$V$7,F13-$V$7,0),0))
H14:H19H14=MAX(IF($W$8,MAX(0,SUM(G$12:G13)+F14-$V$9),0),IF($W$6,IF(F14>$V$7,F14-$V$7,0),0))
A13A13=G8
A14:A19A14=A13+1
G20:K20G20=SUM(G13:G19)
Cells with Data Validation
CellAllowCriteria
B13:B19Timebetween 12:00:00 AM and 11:59:59 PM
D13:D19Timebetween 12:00:00 AM and 11:59:59 PM
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Maybe something like this

Excel Formula:
=IF(OR(B3="",D3=""),0,IF(D3<B3,((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))+24,(((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))-(C3/60))))
 
Upvote 0
Solution
Maybe something like this

Excel Formula:
=IF(OR(B3="",D3=""),0,IF(D3<B3,((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))+24,(((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))-(C3/60))))
i tryed this but it returned err:508 for all cells involved. i looked up the error code and it suggests that there may be more opening ( then closing ) or vise versa
Thank you very much for trying.
 
Upvote 0
i tryed this but it returned err:508 for all cells involved. i looked up the error code and it suggests that there may be more opening ( then closing ) or vise versa
Thank you very much for trying.
Same number of open/close.
Works for me when testing. Maybe you have something set differently
 
Upvote 0
i think it may be that im useing open office at home and my excel sheet is on my laptop useing office 365. ill try it on there.
 
Upvote 0
Maybe something like this

Excel Formula:
=IF(OR(B3="",D3=""),0,IF(D3<B3,((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))+24,(((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))-(C3/60))))
i found the error, the cells in your calculation were missing the 1, cell B13 not B3.
with that adjusted it works perfectly. Thank you so much.
 
Upvote 0
i found the error, the cells in your calculation were missing the 1, cell B13 not B3.
with that adjusted it works perfectly. Thank you so much.
Maybe something like this

Excel Formula:
=IF(OR(B3="",D3=""),0,IF(D3<B3,((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))+24,(((MROUND((D3*24),0.25)-MROUND((B3*24),0.25)))-(C3/60))))
I have tried the formula you provided and i keep getting a #Value! error. I am wondering if it is because my new time clock is showing times as a 24 hour clock. Can you give me any assistance as to how i can correct my error?
I have tried to upload a mini sheet but the spreadsheet i am using won't seem to let me use the XL2BB add on.

1708965472559.png
 
Upvote 0

Forum statistics

Threads
1,223,955
Messages
6,175,605
Members
452,660
Latest member
Zatman

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