time duration in one cell

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
444
Office Version
  1. 2019
hi all, may i know is it possible to count the time duration between start & end and deduct 45min for the meal break in one cell?

09:15 - 18:458.75
09:15 - 18:458.75
10:45 - 21:009.5
13:00 - 21:007.25

thanks for the help :geek:
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi, here is one option.

Book1
AB
109:15 - 18:458.75
209:15 - 18:458.75
310:45 - 21:009.5
413:00 - 21:007.25
Sheet1
Cell Formulas
RangeFormula
B1:B4B1=(RIGHT(A1,5)-"00:45"-LEFT(A1,5))*24
 
Upvote 0
thanks for your option!
i'm sorry that i wonder can i sum it together(total 34.25) at once or i need to use your formula, then sum ?
 
Upvote 0
or i need to use your formula, then sum

That's probably the easier, more transparent way, but it can be done in one step.

Book1
A
109:15 - 18:45
209:15 - 18:45
310:45 - 21:00
413:00 - 21:00
5
634.25
Sheet1
Cell Formulas
RangeFormula
A6A6=(SUMPRODUCT(RIGHT("00:00"&A1:A4,5)-LEFT(A1:A4&"00:00",5))-("00:45"*COUNTA(A1:A4)))*24
 
Upvote 0
Book1
C
5110:00 - 19:30
52
53
5409:15 - 18:45
5509:15 - 18:45
5611:30 - 21:00
57
5811:30 - 21:00
5900:00 - 00:00
6009:15 - 18:45
61
62
63
6409:15 - 18:45
6509:15 - 18:45
6611:30 - 21:00
6709:15 - 18:45
68
6911:30 - 21:00
70
7111:30 - 21:00
7211:30 - 21:00
7309:15 - 18:45
74
7509:15 - 18:45
7600:00 - 00:00
77
7809:15 - 18:45
7909:15 - 18:45
8011:30 - 21:00
8111:30 - 21:00
8209:15 - 18:45
8300:00 - 00:00
84165.25
RESULT-1
Cell Formulas
RangeFormula
C84C84=(SUMPRODUCT(RIGHT("00:00"&C51:C83,5)-LEFT(C51:C83&"00:00",5))-("00:45"*COUNTA(C51:C83)))*24
Named Ranges
NameRefers ToCells
'RESULT-1'!Print_Area='RESULT-1'!$A$39:$AD$85C84


thanks for your prompt reply
what's wrong with mine on those 00:00 - 00:00?
it should be 166.25?
 
Upvote 0
it should be 166.25

I think it should be 175 - to handle the zero times (and blanks produced by a formula) try:

=(SUMPRODUCT(RIGHT("00:00"&C51:C83,5)-LEFT(C51:C83&"00:00",5))-("00:45"*COUNTIFS(C51:C83,"?*",C51:C83,"<>00:00 - 00:00")))*24
 
Upvote 0
ugh despite i dont know why it is 175, but if i use your first formula which in #2 for every one and sum total, it is exactly 175 exclude 00:00 - 00:00

THANK YOU SO MUCH FOR YOUR HELP. :eek:
 
Upvote 0
Hi FormR
can this formula be used in this case when my employee applied leave like this table?
thank you very much

Book1
ABCDEFGHIJKLMNOPQ
117.526.2526.25#VALUE!#VALUE!#VALUE!17.5
2
3Bee09:30 - 19:0011:30 - 21:0011:30 - 21:0012:00 - 21:3012:00 - 21:3043.75
4Brenda00:00 - 00:0009:15 - 18:4509:15 - 18:45Unpaid Leave Day 1.0Unpaid Leave Day 1.0Unpaid Leave Day 1.0#VALUE!
5Brian09:15 - 18:4509:15 - 18:4510:00 - 19:3011:30 - 21:0010:00 - 19:3043.75
6Carlie09:15 - 18:4509:15 - 18:4512:00 - 21:30Vacation Leave Day 1.0Vacation Leave Day 1.0#VALUE!
Sheet1
Cell Formulas
RangeFormula
B1, N1, L1, J1, H1, F1, D1B1=(SUMPRODUCT(RIGHT("00:00"&B3:B6,5)-LEFT(B3:B6&"00:00",5))-("00:45"*COUNTIFS(B3:B6,"?*",B3:B6,"<>00:00 - 00:00")))*24
Q3:Q6Q3=(SUMPRODUCT(RIGHT("00:00"&B3:O3,5)-LEFT(B3:O3&"00:00",5))-("00:45"*COUNTIFS(B3:O3,"?*",B3:O3,"<>00:00 - 00:00")))*24
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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