Formula to calculate waiting hours between three date& time on my data

Lukma

Board Regular
Joined
Feb 12, 2020
Messages
240
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
HI Guys

Please i need a help with the solution of my data vessel arrive time at FWB Column C2 and loading manifest paper work passed Time in Column D2 and permission is granted to vessel to enter port in Column F2

my aim is to get the waiting hours it took ESNAAD to grant permission to vessel after receiving manifest and total hours Vessel takes waiting for permission at FWB after or before manifest passed to ESNAAD.

Appreciate anyone with the formula to get the waiting hours for vessel to get permission take in FWB

Book1
ABCDEFGHI
1Mus-NoSupply VesselFWB Date & TimeManifest Passed ESNAAD Date & TimeTotal hrs takes Vessel Waiting permision After or before manifest timeESNAAD PermissionTotal hrs takes take to grant Permision After manifest passedArrive Date & TimeCommence Cargo OP
2Mus-3708SMIT LUZON31/12/20 22:4231/12/20 13:3501/01/21 04:1401/01/21 08:3001/01/21 08:42
3Mus-3709SMIT LUMUT31/12/20 22:3031/12/20 18:0031/12/20 23:0001/01/21 05:2001/01/21 07:58
4Mus-3711MAC PHOENIX31/12/20 21:4231/12/20 20:3501/01/21 05:0501/01/21 09:4501/01/21 13:30
5Mus-3712ADNOC-81201/01/21 01:3031/12/20 21:0001/01/21 04:4501/01/21 08:0501/01/21 08:25
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:E5Cell Valuecontains "Maintenance"textNO
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
With Power Query/Get and Transform. See last column.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Mus-No", Int64.Type}, {"Supply Vessel", type text}, {"FWB#(lf)Date & Time", type datetime}, {"Manifest Passed#(lf)ESNAAD#(lf)Date & Time", type datetime}, {"Total hrs takes Vessel Waiting permision #(lf)After or before manifest time", type any}, {"ESNAAD#(lf)Permission", type datetime}, {"Total hrs takes take to grant Permision#(lf)After manifest passed", type any}, {"Arrive #(lf)Date & Time", type datetime}, {"Commence #(lf)Cargo OP", type datetime}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [#"ESNAAD#(lf)Permission"]-[#"FWB#(lf)Date & Time"]),
    #"Renamed Columns" = Table.RenameColumns(#"Added Custom",{{"Custom", "Wait Time"}})
in
    #"Renamed Columns"

Book1
ABCDEFGHIJ
1Mus-NoSupply VesselFWB Date & TimeManifest Passed ESNAAD Date & TimeTotal hrs takes Vessel Waiting permision After or before manifest timeESNAAD PermissionTotal hrs takes take to grant Permision After manifest passedArrive Date & TimeCommence Cargo OPWait Time
23708SMIT LUZON12/31/2020 22:4212/31/2020 13:351/1/2021 4:141/1/2021 8:301/1/2021 8:425:32
33709SMIT LUMUT12/31/2020 22:3012/31/2020 18:0012/31/2020 23:001/1/2021 5:201/1/2021 7:580:30
43711MAC PHOENIX12/31/2020 21:4212/31/2020 20:351/1/2021 5:051/1/2021 9:451/1/2021 13:307:23
53712ADNOC-8121/1/2021 1:3012/31/2020 21:001/1/2021 4:451/1/2021 8:051/1/2021 8:253:15
Table1
 
Upvote 0
thanks and i appreciate but i feel like have formula to get it more easy for me

if there is other mean of formula i will be glad give it a try

Regards
 
Upvote 0
Hi Alansidman

Thanks so much but am not too familiar with Power Query still in learning stage that am must be frank with
i only extract few or my data to what i need because my data in much which i enter daily based on the operation

If there is other formula i will more pleased

Regards

 
Upvote 0
This worked for me

=F2-D2 formatted special as hh:mm and copied down.
 
Upvote 0
Thanks yes i know but how did you get the waiting time in last column 5:32 is there any formula to do this without using power Query

am not to good in power Query that's why i prefer a formula that do this.

Appreciate if anyone can help out

Regards
 
Upvote 0
Post #5 is not about Power Query. It is a simple excel formula.
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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