Timesheet formulas
I'm trying to create an iCloud based timesheet in Numbers. What is the formula to round the hours worked to the nearest 15 minutes?
Thanks in advance!
pining4co
MacBook Pro 13″, macOS 10.15
I'm trying to create an iCloud based timesheet in Numbers. What is the formula to round the hours worked to the nearest 15 minutes?
Thanks in advance!
pining4co
MacBook Pro 13″, macOS 10.15
Hi p4c,
The likely function is MROUND, which rounds a number to a specified multiple.
As we're starting with a Duration, we'll need to convert that value to the equivalent number of hours using DUR2HOURS before rounding.
And, assuming the end answer is to be a Duration, we'll need DURATION to convert the rounded number back to a Duration.
Formula, as entered in B2: DURATION(weeks,days,MROUND(DUR2HOURS(B2),0.25),minutes,seconds,milliseconds)
The formula can be shortened slightly to: DURATION(,,MROUND(DUR2HOURS(B4),0.25),minutes)
Note that the two commas between the first ( and MROUND are required to tell DURATION that the number being presented represents 'number of hours. 'seconds and milliseconds, and their preceding commas may be removed as the smallest unit in the result will be minutes.
After entering the formula in C2, fill it down as many rows as you need.
Regards,
Barry
Hi p4c,
The likely function is MROUND, which rounds a number to a specified multiple.
As we're starting with a Duration, we'll need to convert that value to the equivalent number of hours using DUR2HOURS before rounding.
And, assuming the end answer is to be a Duration, we'll need DURATION to convert the rounded number back to a Duration.
Formula, as entered in B2: DURATION(weeks,days,MROUND(DUR2HOURS(B2),0.25),minutes,seconds,milliseconds)
The formula can be shortened slightly to: DURATION(,,MROUND(DUR2HOURS(B4),0.25),minutes)
Note that the two commas between the first ( and MROUND are required to tell DURATION that the number being presented represents 'number of hours. 'seconds and milliseconds, and their preceding commas may be removed as the smallest unit in the result will be minutes.
After entering the formula in C2, fill it down as many rows as you need.
Regards,
Barry
Timesheet formulas