What time is it right now (e.g. 2:15PM) & how do I calculate off that?

Ersh

New Member
Joined
Mar 11, 2009
Messages
4
I'm working on a scheduling tool and I need to run a variety of time calculations. It's hard to explain all the nitty gritty details, but at a high level I'm doing a lot of back and forth conversion between decimals and time. I'm wondering what your thoughts are...do you try to do your math directly on Time fields or is it just as simple to use decimals?

A
B
C
D
1
Label
Data
Data Format
Formula
2

current time (as fraction of 24 hours)

<tbody>
</tbody>

0.6270

<tbody>
</tbody>

Number

<tbody>
</tbody>

=NOW()-TODAY()

<tbody>
</tbody>
3

current time (hours)

<tbody>
</tbody>

15.0474

<tbody>
</tbody>

Number

<tbody>
</tbody>

=B2*24

<tbody>
</tbody>
4

current time (whole hours)

<tbody>
</tbody>

15

<tbody>
</tbody>

Number

<tbody>
</tbody>

=LEFT(B3,FIND(".",B3)-1)

<tbody>
</tbody>
5

current time (minutes)

<tbody>
</tbody>

2.8457

<tbody>
</tbody>

Number

<tbody>
</tbody>

=MID(B3,FIND(".",B3),10)*60

<tbody>
</tbody>
6

current time (whole minutes)

<tbody>
</tbody>

2

<tbody>
</tbody>

Number

<tbody>
</tbody>

=LEFT(B5,FIND(".",B5)-1)

<tbody>
</tbody>
7

current time (seconds)

<tbody>
</tbody>

50.7400

<tbody>
</tbody>

Number

<tbody>
</tbody>

=MID(B5,FIND(".",B5),10)*60

<tbody>
</tbody>
8

current time (whole seconds)

<tbody>
</tbody>

50

<tbody>
</tbody>

Number

<tbody>
</tbody>

=LEFT(B7,FIND(".",B7)-1)

<tbody>
</tbody>
9

current time (re-constructed)

<tbody>
</tbody>

3:02:50 PM

<tbody>
</tbody>

Time

<tbody>
</tbody>

=TIME(B4,B6,B8)

<tbody>
</tbody>
10

end of day (4:45 PM)

<tbody>
</tbody>

4:45 PM

<tbody>
</tbody>

Time

<tbody>
</tbody>

4:45 PM

<tbody>
</tbody>
11

end of day (4:45 PM as fraction of 24 hours)

<tbody>
</tbody>

0.6979

<tbody>
</tbody>

Number

<tbody>
</tbody>

=(16+0.75)/24

<tbody>
</tbody>
12

remaining time (hours)

<tbody>
</tbody>

1.7026

<tbody>
</tbody>

Number

<tbody>
</tbody>

=(B11-B2)*24

<tbody>
</tbody>
13

remaining time (minutes)

<tbody>
</tbody>

42.1543

<tbody>
</tbody>

Number

<tbody>
</tbody>

=MID(B12,FIND(".",B12),10)*60

<tbody>
</tbody>
14

remaining time (seconds)

<tbody>
</tbody>

9.2600

<tbody>
</tbody>

Number

<tbody>
</tbody>

=MID(B13,FIND(".",B13),10)*60

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi.

I would always use the built-in date and time functions. Internally they expect the dates to be in whole numbers of days after1/1/1900 and the hours are stored as fractions of days so they make up the fractional part of the number.

If you do that you will have all these functions you can use plus easy use of the built-in date and time formats: https://support.office.com/en-gb/ar...4e4-a2bc-3230a10786fa&ui=en-US&rs=en-GB&ad=GB

The functions will let you add days, subtract dates, calculate working days between two dates, find the end of a month etc etc.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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