Calculating Time Duration

Avanz

New Member
Joined
May 30, 2022
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
Hi Everyone,

I am so happy to have found this forum. I will try and explain my question as best as I can, but I’m a beginner user so please feel free to ask me questions to explain anything further.

At work I am meant to calculate the durations between Arrival & Departures times for certain items. I am able to easily do this by Changing the times to hh:mm AM/PM and then using =(Departure-Arrival) to get the duration.

However, I struggle when the Arrival times in the sheet is different from “Given Times”.

So sometimes the goods come early or later than given times. If they arrive early I have to calculate the duration between Given time - departure and if they arrive late, I have to calculate the duration between Arival time and departure.

I have been doing manually everyday for 50+ Items and absolutely sick of it. Is there any easier way to do this?

Thank You!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
as we cannot see a sample set of data
how about

=IF ( Arrival time < Given time , Given time - departure , Arrival time and departure )

Not sure why you have to do this
I am able to easily do this by Changing the times to hh:mm AM/PM and then using =(Departure-Arrival) to get the duration.
Unless the time is in text format - But again, not being able to see the data , can not advise really

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Upvote 0
as we cannot see a sample set of data
how about

=IF ( Arrival time < Given time , Given time - departure , Arrival time and departure )

Not sure why you have to do this

Unless the time is in text format - But again, not being able to see the data , can not advise really

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
Here's a screenshot for reference

1653912089964.png
 
Upvote 0
doesnt help a lot - can see cell references
also you have 1 column with Given time
but 2 columns for Arrival and 2 for Departure

As i say
=IF ( Arrival time < Given time , Given time - departure , Arrival time and departure )

Also
If they arrive early I have to calculate the duration between Given time - departure and if they arrive late, I have to calculate the duration between Arival time and departure.

looking at the row with 1:15
given time 9am - arrival time 7 am - so as early - then use Given time - departure

given time is 9am, departure is 9:15 am - so 0:15

so no idea how you come to the time you have

can you explain further and also use XL2BB as I linked to , or put the sheet on a share with an explanation and manually add examples so we know how you calculate

at the moment i dont see it - BUT maybe i'm missing something obvious
 
Upvote 0
doesnt help a lot - can see cell references
also you have 1 column with Given time
but 2 columns for Arrival and 2 for Departure

As i say


Also


looking at the row with 1:15
given time 9am - arrival time 7 am - so as early - then use Given time - departure

given time is 9am, departure is 9:15 am - so 0:15

so no idea how you come to the time you have

can you explain further and also use XL2BB as I linked to , or put the sheet on a share with an explanation and manually add examples so we know how you calculate

at the moment i dont see it - BUT maybe i'm missing something obvious
Hi sorry about that, I'll try to add the sheet.

1.the timeslot columns are meant to be "given times"

2. The 1:15 is a over all total time of both sim a (total time) + Sim b (total time)

3. I am also meant to calculate the overall total time in decimals.





book1.xlsx
ABCDEFGHIJ
1DateItem PickTimeslot (Given Time)ArrivalDepartureItem DropTimeslot ArrivalDepartureTOTAL TIME
230/05/2022SIM A09:00 AM09:00 AM09:45 PMSIM B11:00 AM11:00 AM12:30 AM1.75
330/05/2022SIM A09:00 AM09:15 AM10:00 AMSIM B11:00 AM10:45 AM12:00 PM2
430/05/2022SIM A08:00 AM08:30 AM09:00 AMSIM B10:00 AM10:00 AM11:45 AM
530/05/2022SIM A09:00 AM08:30 AM10:00 AMSIM B12:00 PM11:45 AM2:00 PM3
630/05/2022SIM A08:00 AM08:15 AM09:20 AMSIM B10:00 AM10:00 AM12:00 PM
730/05/2022SIM A08:00 AM08:00 AM10:20 AMSIM B4:00 PM4:00 PM5:00 PM
830/05/2022SIM A09:00 AM07:00 AM09:15 AMSIM B12:00 PM11:00 AM1:00 PM
930/05/2022SIM A10:00 AM10:45 AM11:30 AMSIM B12:40 PM1:00 PM3:00 PM
1030/05/2022SIM A10:00 AM11:30 AM12:30 AMSIM B1:20 PM1:30 PM3:40 PM
Sheet1
Cell Formulas
RangeFormula
J2J2=(0.75+1)
J3J3=(1+1)
J5J5=(1+2)
 
Upvote 0
the 1:15 seems to have disappeared now
i'm really sorry , i am trying to help you

but i'm not following your example , which seems to have different results in column J - total time

can you explain how you do the calculations manually - using cell reference and a bit of explanation
for each row

in row 2 you have 0.75+1
how did you work those out and why
 
Upvote 0
the 1:15 seems to have disappeared now
i'm really sorry , i am trying to help you

but i'm not following your example , which seems to have different results in column J - total time

can you explain how you do the calculations manually - using cell reference and a bit of explanation
for each row

in row 2 you have 0.75+1
how did you work those out and why
Hi,

Its okay, I understand, also I seem to have figured it out.

=Depart-MAX(arrival,timeslot)
 
Upvote 0
ok, glad you have it sorted now
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,250
Members
451,757
Latest member
iours

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