Need help with formula next occurrence of specific name and total days spent before returning

Lukma

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

I need help with a formula in COLUMN F, Column G, and Column H
I have my data with the names of the Vessels in Column C, and I also have the Departure Date and time in Column E, but I need to have the vessel's next occurrence in Column F, and the Return date & time in Port in Column D to get total Numbers of days spent outside before returning
For Example, I have Vessel Name in Cecilie-K Departed date & time from Port in column E and the Return Date & Time In Port in column D

Please i will appreciate someone with a formula, without using the Array formula it slows my report

Regards


OSMS-Onshore Jetty Operations vessels Tracking.xlsx
BCDEFGH
4Mus NumSupply VesselVessel Arrive ADNOC Port Date & TimeVessel Depart Port Date & Time Vessel Name Return Date Total Time in Days Spent Return
51153ADNOC-230
61154CECILIE-K01/05/23 18:0602/05/23 04:48CECILIE-K02/05/23 16:500.50
71155Z-OCEAN01/05/23 18:1002/05/23 04:15
81156SWISSCO RUBY02/05/23 09:3503/05/23 00:10
91157LCT-SHEWELEH01/05/23 23:0502/05/23 04:20
101158A-RANGER02/05/23 00:2502/05/23 04:50
111159ADNOC-S0202/05/23 03:0002/05/23 20:10
121160ADNOC-81001/05/23 22:5006/05/23 04:00
131161ADNOC-51102/05/23 02:3502/05/23 07:50
141162SK MAINSTAY02/05/23 09:5503/05/23 01:30
151163MUTAWA-40202/05/23 06:3002/05/23 18:24
161164ADNOC-51202/05/23 11:5505/05/23 11:30
171165CECILIE-K02/05/23 16:5006/05/23 05:00
181166Z-POWER02/05/23 14:3503/05/23 13:55
191167ADNOC-81102/05/23 15:3005/05/23 15:15
201168ADNOC-22202/05/23 16:2003/05/23 14:10
211169SMIT LUMUT02/05/23 23:5903/05/23 17:10
221170A-RADIANT-702/05/23 20:1003/05/23 02:10
231171LCT MARWAH-102/05/23 15:4505/05/23 21:50
241172ADNOC-85103/05/23 10:1005/05/23 12:05
251173AMS-ONYX02/05/23 22:4503/05/23 14:05
261174ATLAS-SAPPHIRE02/05/23 21:2003/05/23 14:00
271175M-SUPPORTER03/05/23 05:2004/05/23 14:15
281176Z-OCEAN02/05/23 22:3503/05/23 13:00
291177LCT-SHEWELEH03/05/23 02:5003/05/23 14:15
Sheet1
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Assuming your data is already chronologically sorted, this might work:

Book3
ABCDEFG
1Mus NumSupply VesselVessel Arrive ADNOC Port Date & TimeVessel Depart Port Date & Time Vessel Name Return Date Total Time in Days Spent Return
21153ADNOC-230#N/A#N/A#N/A
31154CECILIE-K01/05/23 6:06 PM02/05/23 4:48 AMCECILIE-K02-05-23 4:50 PM0.5
41155Z-OCEAN01/05/23 6:10 PM02/05/23 4:15 AMZ-OCEAN02-05-23 10:35 PM0.8
51156SWISSCO RUBY02/05/23 9:35 AM03/05/23 12:10 AM#N/A#N/A#N/A
61157LCT-SHEWELEH01/05/23 11:05 PM02/05/23 4:20 AMLCT-SHEWELEH03-05-23 2:50 AM0.9
71158A-RANGER02/05/23 12:25 AM02/05/23 4:50 AM#N/A#N/A#N/A
81159ADNOC-S0202/05/23 3:00 AM02/05/23 8:10 PM#N/A#N/A#N/A
91160ADNOC-81001/05/23 10:50 PM06/05/23 4:00 AM#N/A#N/A#N/A
101161ADNOC-51102/05/23 2:35 AM02/05/23 7:50 AM#N/A#N/A#N/A
111162SK MAINSTAY02/05/23 9:55 AM03/05/23 1:30 AM#N/A#N/A#N/A
121163MUTAWA-40202/05/23 6:30 AM02/05/23 6:24 PM#N/A#N/A#N/A
131164ADNOC-51202/05/23 11:55 AM05/05/23 11:30 AM#N/A#N/A#N/A
141165CECILIE-K02/05/23 4:50 PM06/05/23 5:00 AM#N/A#N/A#N/A
151166Z-POWER02/05/23 2:35 PM03/05/23 1:55 PM#N/A#N/A#N/A
161167ADNOC-81102/05/23 3:30 PM05/05/23 3:15 PM#N/A#N/A#N/A
171168ADNOC-22202/05/23 4:20 PM03/05/23 2:10 PM#N/A#N/A#N/A
181169SMIT LUMUT02/05/23 11:59 PM03/05/23 5:10 PM#N/A#N/A#N/A
191170A-RADIANT-702/05/23 8:10 PM03/05/23 2:10 AM#N/A#N/A#N/A
201171LCT MARWAH-102/05/23 3:45 PM05/05/23 9:50 PM#N/A#N/A#N/A
211172ADNOC-85103/05/23 10:10 AM05/05/23 12:05 PM#N/A#N/A#N/A
221173AMS-ONYX02/05/23 10:45 PM03/05/23 2:05 PM#N/A#N/A#N/A
231174ATLAS-SAPPHIRE02/05/23 9:20 PM03/05/23 2:00 PM#N/A#N/A#N/A
241175M-SUPPORTER03/05/23 5:20 AM04/05/23 2:15 PM#N/A#N/A#N/A
251176Z-OCEAN02/05/23 10:35 PM03/05/23 1:00 PM#N/A#N/A#N/A
261177LCT-SHEWELEH03/05/23 2:50 AM03/05/23 2:15 PM#N/A#N/A#N/A
Sheet1
Cell Formulas
RangeFormula
E2:E26E2=VLOOKUP($B2,$B3:$D$1000,1,0)
F2:F26F2=VLOOKUP($B2,$B3:$D$1000,2,0)
G2:G26G2=F2-D2
 
Upvote 0
Solution
Dear Arandom

Many Thanks, it really works out for me

Regards​

 
Upvote 0

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

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