Time

P

Panski

If a cell contains 7A-3P (Day shift). Is there a way to calulate the total
hours in another cell?

Thank you,

Paul

I am a new guy
 
P

Peo Sjoblom

Use real times instead of text and put them in separate cells

07:00 AM in A1
03:00 PM in B1


=B1-A1
 
P

Panski

Peo,

Thank you for answering so soon. My supervivor does not want to change
current layout of schedule. I like your way but not able to use it. is there
another way?

Paul
 
P

Peo Sjoblom

Tell her/him he's an idiot!

=SUBSTITUTE(SUBSTITUTE(MID(A1,FIND("-",A1)+1,2),"A",":00 AM"),"P",":00
PM")-SUBSTITUTE(SUBSTITUTE(LEFT(A1,FIND("-",A1)-1),"A",":00 AM"),"P",":00
PM")

if you want it as an integer use

=24*(SUBSTITUTE(SUBSTITUTE(MID(A1,FIND("-",A1)+1,2),"A",":00 AM"),"P",":00
PM")-SUBSTITUTE(SUBSTITUTE(LEFT(A1,FIND("-",A1)-1),"A",":00 AM"),"P",":00
PM"))
 
P

Panski

I agree, he is an idiot. Thanks for the help. I will let you know how things
work out.


Paul
 
Top