# New to Excel

#### twc238

##### New Member
I'm kinda new to excel and need some help on a formula.
I need to calculate Actual drive time and actual work time in units if 1 unit = 5 minutes.

### Excel Facts

Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
A1 is date/time start (format as mm/dd/yy hh:mm)
B1 is date/time finish (format as mm/dd/yy hh:mm)
formula is
Code:
``=CEILING(24*60*(B1-A1),5)/5``
rounds up to the next 5 minute interval, 28 min = 6 units

Thanks Phil, but could you explain where the numbers come from so I can understand it a little better. =ceiling(24(hrs)x60(minutes)x (cells), 5?)/5?

The values in cells A1 & B1 are in days and fractions of days. If you put in 03/11/2009 12:00 (that's noon), Excel preserves that value as 39883.5

B1-A1 is the finish date/time - the start date/time, so if you start at 3/11/2009 12:05 and end at 3/11/2009 12:22 the math works out as
39883.5152777778-39883.5034722222 = 0.01180555555

Multiplying that value by 24*60 gives the number of minutes used (17)

Using the ceiling function with a 5 as the second parameter rounds the first parameter (17) up to the next multiple of 5 (so 17 minutes would be converted to 20)
dividing that by 5 to convert to units results in 4

Thanks Phil.........That actually help me see it in my head....so I have a better understanding of it so I can explain it to others........

appreciate it....

You're welcome, and welcome to the board.

Replies
0
Views
159
Replies
2
Views
212
Replies
0
Views
122
Replies
3
Views
138
Replies
2
Views
127

1,216,297
Messages
6,129,958
Members
449,545
Latest member
SURY

### 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.

### Which adblocker are you using?

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

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