difference between times

dashing_peep08

Board Regular
Joined
Jul 3, 2007
Messages
75
11:12PM 2:00AM
8:46AM 9:32AM
9:32AM 10:05AM
10:05AM 10:17AM
10:17AM 10:38AM
10:38AM 10:51AM
10:51AM 11:00AM
11:00AM 11:17AM
11:17AM 12:11PM
12:11PM 12:37PM
12:38PM 1:06PM
1:06PM 1:17PM

supposed i have these log in and log out. how do i get each of the time elapsed. pls note that there is no space between time and the text am or pm. and some of the times are from am to pm. its easy if they are both pm or am but when they are changing from noon to am or am to noon im having this problem

Please help me.

thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
11:12PM 2:00AM

Please put your exact text. It looks like there is a space between the first AM and a number.

If you mean there is no space between the number and PM
like:

Then Ok

Is your data formatted as text, general, number, time????


michael
 
Upvote 0
Excel Workbook
ABCDE
1Log InLog OutLog InLog OutElapsed
211:12PM2:00AM11:12 PM2:00 AM2:48
38:46AM9:32AM8:46 AM9:32 AM0:46
49:32AM10:05AM9:32 AM10:05 AM0:33
510:05AM10:17AM10:05 AM10:17 AM0:12
610:17AM10:38AM10:17 AM10:38 AM0:21
710:38AM10:51AM10:38 AM10:51 AM0:13
810:51AM11:00AM10:51 AM11:00 AM0:09
911:00AM11:17AM11:00 AM11:17 AM0:17
1011:17AM12:11PM11:17 AM12:11 AM12:54
1112:11PM12:37PM12:11 AM12:37 AM0:26
1212:38PM1:06PM12:38 AM1:06 PM12:28
131:06PM1:17PM1:06 PM1:17 PM0:11
Sheet
 
Upvote 0
personal.xls
ABCDE
1StartEndAdjStartAdjEndElapsed
211:12PM2:00AM11:12:00PM2:00:00AM2:48:00
38:46AM9:32AM8:46:00AM9:32:00AM0:46:00
49:32AM10:05AM9:32:00AM10:05:00AM0:33:00
510:05AM10:17AM10:05:00AM10:17:00AM0:12:00
610:17AM10:38AM10:17:00AM10:38:00AM0:21:00
710:38AM10:51AM10:38:00AM10:51:00AM0:13:00
810:51AM11:00AM10:51:00AM11:00:00AM0:09:00
911:00AM11:17AM11:00:00AM11:17:00AM0:17:00
1011:17AM12:11PM11:17:00AM12:11:00PM0:54:00
1112:11PM12:37PM12:11:00PM12:37:00PM0:26:00
1212:38PM1:06PM12:38:00PM1:06:00PM0:28:00
131:06PM1:17PM1:06:00PM1:17:00PM0:11:00
Sheet1


Formula in C2 filled down
Code:
=--SUBSTITUTE(SUBSTITUTE(A2,"AM"," AM"),"PM"," PM")
D2
Code:
=--SUBSTITUTE(SUBSTITUTE(B2,"AM"," AM"),"PM"," PM")
E2
Code:
=IF(D2<C2,(D2+1)-C2,D2-C2)
 
Upvote 0
Datsmart,
Is this Excel Jeanie HTML 4 a paid for thing??
I like it, I am just not sure I want to pay for it.

Michael
 
Upvote 0
Assuming log in "time" in A2 and log out in B2 then with a single formula

=MOD(REPLACE(B2,LEN(B2)-1,0," ")-REPLACE(A2,LEN(A2)-1,0," "),1)

format as time
 
Upvote 0
Daniels,
Excel Jeanie is free if you don't mind the "nag" pop up every now and then. Some features are not available until you register, but it works fine as downloaded for trial. Don't think the trial runs out...

Barry,
Another one or your masterful formula!
I will archive that one.

Thanks,
 
Upvote 0
Very nice Barry!

You can also change:
Code:
=MOD(REPLACE(B2,LEN(B2)-1,0," ")-REPLACE(A2,LEN(A2)-1,0," "),1)
to
Code:
=(MOD(REPLACE(B2,LEN(B2)-1,0," ")-REPLACE(A2,LEN(A2)-1,0," "),1))*24

without changing the format to give you a whole number representation.

Michael
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

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