HELP!! Time formula

MarkAndrews

Well-known Member
Joined
May 2, 2006
Messages
1,970
Office Version
  1. 2010
Platform
  1. Windows
Hi Guys,

I havent posted on here for many years

Im using Office 2010

I have a spreadsheet which i need to calculate the time between but i cannot for the life of me remember how to do this so i wonder if someone could kindly point me in the right direction

In Column B (EG B2) i have this data "2017-09-01 09:00:00 +0100" I need to extract the time only (09:00:00) to go in C2
In Coumn D (EG D2) I have this date "2017-09-01 11:00:00 +0100" i need to extract the time only (11:00:00) to go in E2

Then what i need to do is calculate the difference (EG E2-C2) to go in time in cell F2 and copy down the page

Any help greatly appreciated as this is driving me mad

Many thanks
 
i did show that in H2 as i mentioned if date need to be considred and how to format the cell
=LEFT(D2,20)*1 - LEFT(B2,20)*1
[H]:MM:SS

BUT if you want to include any of the dates if over 24hrs difference

then
=LEFT(D2,20)*1 - LEFT(B2,20)*1
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
i did show that in H2 as i mentioned if date need to be considred and how to format the cell
=LEFT(D2,20)*1 - LEFT(B2,20)*1
[H]:MM:SS
How would i get the result in C2 to show as "DD/MM/YYYY HH:MM" and still be able to do the original calculations as per original post

Apologies i always struggle with time and date calculations so any help greatly appreciated
 
Upvote 0
in c2 put
=LEFT(B2,20)*1
in e2 put
=LEFT(D2,20)*1

format the cell as
DD/MM/YYYY HH:MM

Book6
ABCDEFGH
1
22017-09-01 09:00:00 +01009/1/17 9:002017-09-01 11:00:00 +01009/1/17 11:000.0833333330.083333333
3
Sheet1
Cell Formulas
RangeFormula
C2,E2C2=LEFT(B2,20)*1
F2F2=TIMEVALUE(MID(D2,11,9)) - TIMEVALUE(MID(B2,11,9))
H2H2=LEFT(D2,20)*1 - LEFT(B2,20)*1
 
Upvote 1
Solution
in c2 put
=LEFT(B2,20)*1
in e2 put
=LEFT(D2,20)*1

format the cell as
DD/MM/YYYY HH:MM

Book6
ABCDEFGH
1
22017-09-01 09:00:00 +01009/1/17 9:002017-09-01 11:00:00 +01009/1/17 11:000.0833333330.083333333
3
Sheet1
Cell Formulas
RangeFormula
C2,E2C2=LEFT(B2,20)*1
F2F2=TIMEVALUE(MID(D2,11,9)) - TIMEVALUE(MID(B2,11,9))
H2H2=LEFT(D2,20)*1 - LEFT(B2,20)*1
Absolute legend! Thankyou so much!!
 
Upvote 0
How would i extract not only the time but the date too as a valid excel date? as "DD/MM/YYYY"

Many thanks

Try

Book4
ABCDEFG
1
2Date and Time2017-09-01 09:00:00 +01009/1/2017 9:002017-09-01 11:00:00 +01009/1/2017 11:002:00:00
3Date Only2017-09-01 09:00:00 +010009/01/20172017-09-01 11:00:00 +010009/01/20170:00:00
4Time Only2017-09-01 09:00:00 +01009:00:002017-09-01 11:00:00 +010011:00:002:00:00
5
6
Sheet1
Cell Formulas
RangeFormula
E2,C2E2=LEFT(D2,19)+0
F2:F4F2=E2-C2
E3,C3E3=LEFT(D3,11)+0
E4,C4E4=MID(D2,SEARCH("??:??:??",D2),8)+0
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,790
Members
448,994
Latest member
rohitsomani

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