+ Reply to Thread
Results 1 to 10 of 10

calculate if a car has made a return journey

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65

    calculate if a car has made a return journey

    Hi all

    Im working on a work project to see if a car has made a return journey

    There are a number of "trips", but for simplicity, ive made them just 2, LOBH (london to birmingham) and BHLO (Birmingham to London)
    There is a date and time in seperate field of when the car passed a checkpoint
    There is a unique booking ID which i think serves no purpose in this task as its not sequential
    then there is the car registration

    In this example there are only a few rows, but there are over 30k entries in the actual file.

    I would like to somehow highlight cars that went to and came back from locations.

    Not every car would return, and if a car does return it could be the same day or several days later.

    Sorting the data in real life would not work so easily as there could be thousand entries before the return happens,

    I would appreciate any help around this!

    File attached

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: calculate if a car has made a return journey

    Can you not just have another 2 columns for the return journey rather than a separate row?

    Also, is your example just to show the data structure, and therefore not accurate? As rows 7 & 8 appear to show the same return journey?

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculate if a car has made a return journey

    Hi rikkyshh,

    Perhaps a Pivot Table would help. See the attached.

    PT for Trips.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: calculate if a car has made a return journey

    Also, could you have a round trip like London to Birmingham, then Birmingham to Bristol, then Bristol to London (plus many other convoluted trips)?

    Pete

  5. #5
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65
    Quote Originally Posted by EchoPassenger View Post
    Can you not just have another 2 columns for the return journey rather than a separate row?

    Also, is your example just to show the data structure, and therefore not accurate? As rows 7 & 8 appear to show the same return journey?
    Hi, unfortunately journies are electronically registered and appear on seperate rows.

    Data was for demo purposes only

    Thank you

  6. #6
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65
    Quote Originally Posted by Pete_UK View Post
    Also, could you have a round trip like London to Birmingham, then Birmingham to Bristol, then Bristol to London (plus many other convoluted trips)?

    Pete
    Hi Pete, only 2 and from journies. No round trips

  7. #7
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: calculate if a car has made a return journey

    Can a car only ever appear in 2 entries max? i.e. A returned journey. Or could a car make multiple journeys and returns? And if so could it be the same journey?
    Last edited by EchoPassenger; 02-11-2019 at 03:30 PM.

  8. #8
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65

    Re: calculate if a car has made a return journey

    Hi mate, I guess it needs to make the return journy at some point to make another trip, but i would need to count each time it does it. It will over the period make many journies and often the same

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: calculate if a car has made a return journey

    Two proposals.

    1st one uses a helper column that combines dates and times for ease of comparisons. Then in column G of attached
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or without a helper as in column H
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  10. #10
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65

    Re: calculate if a car has made a return journey

    Hi Dave, This is great, it almost works, but a journey out is recorded as LOMA and the return is MALO

    I will have a play around but i think the pivot maybe the easiest option

    Thank you all!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By Ron Coderre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 PM
  2. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By Ron Coderre in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  6. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. [SOLVED] How do I calculate rate when pmt is made at end of periods
    By hsummer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1