Add 30 mins to a time going bonkers

Diesel9a1

New Member
Joined
Feb 12, 2015
Messages
37
Ok, so hopefully the table below explains the issue - the 38.00 in column Q is the problem. The issue seems to occur if I have a none on the hour start time with and try to add 30 minutes:
(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0)))


L
Start

M
Finish
N
(Deduct 30' Lunch)
O
(Decimal Shift)
P
(T'Sheet Hours)
Q
(Invoice Qty)
07:0016:00N8.508:309.00
07:0016:00Y8.508:308.50
07:3016:00N8.00
8:0038.00
07:3016:00Y8.008:008.00
21:0006:00N8.508:309.00
21:0006:00Y8.508:308.50
21:3006:00N8.008:0038.00
21:3006:00Y8.008:008.00

<tbody>
</tbody>

O Column = P2*24

P Column = ((M2-L2+(M2<L2))-TIME(0,30,0))

Q Column = IF(N2="Y",(P2*24),(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0))))



Thanks in advance folks.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Ok, so hopefully the table below explains the issue - the 38.00 in column Q is the problem. The issue seems to occur if I have a none on the hour start time with and try to add 30 minutes:
(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0)))

<tbody>
</tbody>

O Column = P2*24

P Column = ((M2-L2+(M2<l2))-time(0,30,0))

Q Column = IF(N2="Y",(P2*24),(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0))))
Thanks in advance folks.

Unfortunately, firstly one of your formulae is not complete. Secondly what do you mean by "a none"?

I've highlighted in red in the quote both of those issues.

</l2))-time(0,30,0))
 
Upvote 0
In addition to what stated by BrianJN1, you should also explain what are you trying to calculate and probably we will find a more direct path.

Bye
 
Upvote 0
Tony’s answer works for me and is much simpler and shorter but, FWIW, the problem with yours i# that you need to divide the MINUTE part by 60
 
Upvote 0
Tony’s answer works for me and is much simpler and shorter but, FWIW, the problem with yours i# that you need to divide the MINUTE part by 60

The difference between an Expert and a Power User.

I attempted to amend the existing formula but gave up after a few minutes when I realised existing data could be manipulated to suit purpose, like Barry said "simple".
 
Last edited:
Upvote 0
I've completed the PART formula from original post here in this QUOTE:

Ok, so hopefully the table below explains the issue - the 38.00 in column Q is the problem. The issue seems to occur if I have a none on the hour start time with and try to add 30 minutes:
(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0)))


L
Start
M
Finish
N
(Deduct 30' Lunch)
O
(Decimal Shift)
P
(T'Sheet Hours)
Q
(Invoice Qty)
07:0016:00N8.508:309.00
07:0016:00Y8.508:308.50
07:3016:00N8.008:0038.00
07:3016:00Y8.008:008.00
21:0006:00N8.508:309.00
21:0006:00Y8.508:308.50
21:3006:00N8.008:0038.00
21:3006:00Y8.008:008.00

<tbody>
</tbody>

O Column = P2*24

P Column = ((M2-L2+(M2<L2))-TIME(0,30,0))<l2))-time(0,30,0))

Q Column = IF(N2="Y",(P2*24),(HOUR(P2+TIME(0,30,0))+MINUTE(P2+TIME(0,30,0))))



Thanks in advance folks.


"</l2))-time(0,30,0))
I have a none on the hour start time"
bad English / grammar, but I couldn't think what else to call it
i.e.
on the hour = 21:00, 22:00, 03:00.
none on the hour = 22:03, 22:22, 23:55 etc etc


"what are you trying to calculate" = The total time in decimal (column Q) from Start Time to Finish time and deducting 30 minutes if the "Deduct 30' Lunch" = "Y"

Times are worked shift times in that they also go past midnight so this is why the formula in column Q is a bit complex. If midnight wasn't involved, then a simple finish minus start would suffice. The above all works fine apart from when a "none on the hour start time" is used.
 
Upvote 0
Try this. I decided to ignore your Decimal Shift.
I believe this does what you set out to do:

Excel 2013/2016
LMNOPQ
1StartFinish(Deduct 30' Lunch)(Decimal Shift)(T'Sheet Hours)(Invoice Qty)
27:0016:00N8:309:00
37:0016:00Y8:308:30
47:3016:00N8:008:30
57:3016:00Y8:008:00
621:006:00N8:309:00
721:006:00Y8:308:30
821:306:00N8:008:30
921:306:00Y8:008:00
Sheet1
Cell Formulas
RangeFormula
P2=IF(M20,30,0),M2-L2-TIME(0,30,0))
Q2=IF(N2="N",P2+TIME(0,30,0),P2)
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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