Find the next start date of same vehicle

lunar72

New Member
Joined
Jul 25, 2019
Messages
2
hello everyone,

I have data for various vehicles/trips and i am attempting to show the start date (data i have) and the end date (data that is not provided). I can show this if i can make the connection between the vehicle numbers and populating the start date for the next trip as the end date. unfortunately because of how the information is used it is difficult to maintain the data in descending order. I have tried a few different ways with no success. Any help would be greatly appreciated. I included some sample data and color coded the dates to show the relation between them.


VehicleStart DateEnd Date (Start of Next Trip)
tr-1231/18/20192/3/2019
xi-5872/3/2019
ru-6244/8/2019
tr-1232/3/2019
st-1991/18/2019
tr-12312/13/20181/18/2019
xi-5871/18/20192/3/2019
ru-6243/4/20194/8/2019

<tbody>
</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to Mr Excel forum

Maybe...

A
B
C
1
Vehicle​
Start Date​
End Date (Start of Next Trip)​
2
tr-123​
01/18/2019​
02/03/2019​
3
xi-587​
02/03/2019​
4
ru-624​
04/08/2019​
5
tr-123​
02/03/2019​
6
st-199
01/18/2019​
7
tr-123
12/13/2018​
01/18/2019​
8
xi-587​
01/18/2019​
02/03/2019​
9
ru-624​
03/04/2019​
04/08/2019​

<tbody>
</tbody>


Formula in C2 copied down
=IFERROR(AGGREGATE(15,6,B$2:B$9/((A$2:A$9=A2)*(B$2:B$9>B2)),1),"")

Hope this helps

M.
 
Upvote 0
Another option with array formula:

=IFERROR(SMALL(IF(($A$2:$A$9=A2)*($B$2:$B$9 > B2),($B$2:$B$9)),1),"")

Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,503
Messages
6,125,175
Members
449,212
Latest member
kenmaldonado

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