+ Reply to Thread
Results 1 to 6 of 6

Find trip duration in days, from a cell with multiple dates

  1. #1
    Registered User
    Join Date
    10-03-2020
    Location
    Qatar
    MS-Off Ver
    365
    Posts
    7

    Find trip duration in days, from a cell with multiple dates

    Hi all,
    Need your expert advice on this. I have attached the sample excel file.

    I am preparing a business travel spend report for a client.

    And in one of the fields, I need to include the total trip duration, from the available data given to me.

    (Screenshot below)

    Thanks,
    Alex

    Capture.JPG
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find trip duration in days, from a cell with multiple dates

    Hi,

    =MIN(ABS(MOD(MMULT(AGGREGATE({14,15},6,FILTERXML("<a><b>"&SUBSTITUTE(C2," ","</b><b>")&"</b></a>","//b[string-length(.)=5]"),1),{1;-1}),{-1,1}*366)))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    10-03-2020
    Location
    Qatar
    MS-Off Ver
    365
    Posts
    7

    Re: Find trip duration in days, from a cell with multiple dates

    Thank you so very much !! It worked for me.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742
    You're welcome!

    Regards

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Find trip duration in days, from a cell with multiple dates

    @XOR LX nice new XML trick string-length(.)

    Another one for start date is always at 2nd from the left and end date is always at 2nd from right.

    =MOD(LEFT(RIGHT(C2,10),5)-MID(C2,5,5),"31dec"-"1jan"+1)
    Attached Files Attached Files

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find trip duration in days, from a cell with multiple dates

    Quote Originally Posted by Bo_Ry View Post
    @XOR LX nice new XML trick string-length(.)
    Indeed!

    Quote Originally Posted by Bo_Ry View Post
    =MOD(LEFT(RIGHT(C2,10),5)-MID(C2,5,5),"31dec"-"1jan"+1)
    I like the "31dec"-"1jan"+1 part - clever!

    Regards

+ 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. Replies: 7
    Last Post: 08-19-2019, 07:28 AM
  2. Replies: 15
    Last Post: 05-21-2019, 11:52 PM
  3. Change Start dates upon duration days change in Project timeline calculation.
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2015, 10:28 AM
  4. Count duration between days If another cell contains information
    By steve15 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-10-2015, 01:53 PM
  5. Replies: 4
    Last Post: 02-24-2012, 11:06 AM
  6. Replies: 2
    Last Post: 10-07-2010, 09:27 PM
  7. Duration of time for two dates in days, hours and minutes
    By sgrimm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2006, 09:39 AM

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