+ Reply to Thread
Results 1 to 2 of 2

Longest Gap in List of Dates

  1. #1
    Registered User
    Join Date
    01-11-2010
    Location
    Ft. Worth, TX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Cool Longest Gap in List of Dates

    Greetings,

    In a large list of data, I need to compute the longest gap in a list of dates for each department.

    Department 1 1/1/2010
    Department 2 2/1/2010
    Department 1 3/1/2010
    Department 2 3/1/2010
    Department 1 4/1/2010
    Department 2 3/2/2010

    From the sample list above, I would expect that the result for Department 1 to be 59, and for Department 2 to be 28.

    Any thoughts?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Longest Gap in List of Dates

    Sort your data by department and then date, calculate the differences and then use a pivot table to return the maximum difference for each department.

    Dom
    Attached Files Attached Files
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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