trying to create a formula that will display the total number of hours that the employees are on break based on the current time

Anonymoose2435

New Member
Joined
Jan 27, 2022
Messages
10
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I am trying to create a formula so that if the current time is GREATER than Start of break time, it'll show the difference between them in hh:mm:ss, if not it'll show 00:00:00. But everything is being calculated. Am i missing something? Current time as of this post is 3:58 PM

Module 5 Case Study(1).xlsx
ABCD
4IT SUPPORT / HELPDESKStart of breakTotal hours on break
51person111:55:00 AM03:54:24
62person22:20:00 PM01:29:24
73person39:34:00 AM06:15:24
84person48:56:00 PM18:53:24
95person57:54:00 PM19:55:24
106person612:03:00 PM03:46:24
117person71:17:00 AM14:32:24
128person84:12:00 AM11:37:24
139person95:45:00 AM10:04:24
1410person106:35:00 AM09:14:24
1511person1110:08:00 AM05:41:24
1612person122:07:00 PM01:42:24
1713person131:15:00 PM02:34:24
1814person143:56:00 PM23:53:24
Task 2
Cell Formulas
RangeFormula
D5:D18D5=IF(NOW()>C5,NOW()-C5,TIME(0,0,0))
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
now() also gives the date , integer part of the Date/time
to just get the decimal which is the TIME
NOW()-TRUNC(NOW()

so try
=IF((NOW()-TRUNC(NOW()))>C2,(NOW()-TRUNC(NOW()))-C2,TIME(0,0,0))

Book9
BCDEFG
1IT SUPPORT / HELPDESKStart of breakTotal hours on breakNowTIME generalTime General
2person111:55:0000:00:002/11/22 8:200.3473763890.496527778
3person214:20:0000:00:000.3473763890.597222222
4person309:34:0000:00:000.3473763890.398611111
5person420:56:0000:00:000.872222222
6person519:54:0000:00:000.829166667
7person612:03:0000:00:000.502083333
8person701:17:0007:03:130.053472222
9person804:12:0004:08:130.175
10person905:45:0002:35:130.239583333
11person1006:35:0001:45:130.274305556
12person1110:08:0000:00:000.422222222
13person1214:07:0000:00:000.588194444
14person1313:15:0000:00:000.552083333
15person1415:56:0000:00:000.663888889
Sheet1
Cell Formulas
RangeFormula
E2E2=NOW()
F2:F4F2=NOW()-TRUNC(NOW())
D2:D15D2=IF((NOW()-TRUNC(NOW()))>C2,(NOW()-TRUNC(NOW()))-C2,TIME(0,0,0))
 
Upvote 0
Solution
now() also gives the date , integer part of the Date/time
to just get the decimal which is the TIME
NOW()-TRUNC(NOW()

so try
=IF((NOW()-TRUNC(NOW()))>C2,(NOW()-TRUNC(NOW()))-C2,TIME(0,0,0))

Book9
BCDEFG
1IT SUPPORT / HELPDESKStart of breakTotal hours on breakNowTIME generalTime General
2person111:55:0000:00:002/11/22 8:200.3473763890.496527778
3person214:20:0000:00:000.3473763890.597222222
4person309:34:0000:00:000.3473763890.398611111
5person420:56:0000:00:000.872222222
6person519:54:0000:00:000.829166667
7person612:03:0000:00:000.502083333
8person701:17:0007:03:130.053472222
9person804:12:0004:08:130.175
10person905:45:0002:35:130.239583333
11person1006:35:0001:45:130.274305556
12person1110:08:0000:00:000.422222222
13person1214:07:0000:00:000.588194444
14person1313:15:0000:00:000.552083333
15person1415:56:0000:00:000.663888889
Sheet1
Cell Formulas
RangeFormula
E2E2=NOW()
F2:F4F2=NOW()-TRUNC(NOW())
D2:D15D2=IF((NOW()-TRUNC(NOW()))>C2,(NOW()-TRUNC(NOW()))-C2,TIME(0,0,0))
This worked! thank you!
 
Upvote 0

Forum statistics

Threads
1,216,037
Messages
6,128,439
Members
449,453
Latest member
jayeshw

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