+ Reply to Thread
Results 1 to 10 of 10

Finding the Earliest and Latest Dates for each Task Code

  1. #1
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Finding the Earliest and Latest Dates for each Task Code

    I receive a report with data similar to the attached.

    Example 1.xlsx

    For each Task code I need to extrapolate the Earliest and Latest Dates which work hours spent has taken place against each Task Code.

    I prefer to create a VBA code I can place in columns “E” & “F”, but if anyone can show me a formula to do this I would be grateful.
    For Task Code 1000:
    Earliest Date would be “12/20/2013” (The formula would be in cell “E2”)
    Latest Date would be “10/30/2014” (The formula would be in cell “F2”)
    For Task Code 2000:
    Earliest Date would be “5/30/2013” (The formula would be in cell “E13”)
    Latest Date would be “8/4/2014” (The formula would be in cell “F13”)

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Finding the Earliest and Latest Dates for each Task Code

    The cool thing about dates in XL is they are just numbers....so I used MIN and MAX....HTH....
    Attached Files Attached Files
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Finding the Earliest and Latest Dates for each Task Code

    Hi, and welcome to the forum

    E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    F2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    both copied down

    Change the row 100 reference as appropriate
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Re: Finding the Earliest and Latest Dates for each Task Code

    Judgeh59,

    Thanks for your quick response, but the report is a little more in depth to just use a Min/Max Formula.
    What I failed to mention is that there are about a thousand Task codes in my report with variable amounts of entries per Category.
    For me to write that formula for each task code every time this report is ran isn't reasonable.

  5. #5
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Re: Finding the Earliest and Latest Dates for each Task Code

    Richard,

    Thanks for the Quick response.

    This worked Perfect! Thanks!

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Finding the Earliest and Latest Dates for each Task Code

    My pleasure.

    I forgot to add that you could of course create a macro to populate E2:F2 with those formulae and then copy and paste it down to the last row.

    Hopefully you picked up the typo on F2 where I had written $A3:B$100 rather than $A3:A$100
    Last edited by Richard Buttrey; 10-07-2014 at 01:22 PM.

  7. #7
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Re: Finding the Earliest and Latest Dates for each Task Code

    Quote Originally Posted by Richard Buttrey View Post
    My pleasure.

    I forgot to add that you could of course create a macro to populate E2:F2 with those formulae and then copy and paste it down to the last row.

    Hopefully you picked up the typo on F2 where I had written $A3:B$100 rather than $A3:A$100


    Just tried it in my actual report and the formula didn't work the same. Can I Send you a small portion of my report to see if you can see why?
    Ben

  8. #8
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Re: Finding the Earliest and Latest Dates for each Task Code

    Quote Originally Posted by Richard Buttrey View Post
    My pleasure.

    I forgot to add that you could of course create a macro to populate E2:F2 with those formulae and then copy and paste it down to the last row.

    Hopefully you picked up the typo on F2 where I had written $A3:B$100 rather than $A3:A$100

    I am attaching a bigger example with some real data. In column "H" & "I" I have entered your formula and in Column "L" & "M" I have entered what the solution should be.

    Thanks for your time,
    Ben
    Attached Files Attached Files

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Finding the Earliest and Latest Dates for each Task Code

    Hi,

    The difference is column A. In the first example these were all numeric values. This latest are all text strings.
    This complicates the formulae somewhat and they need to be changed as follows

    H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    NB. These are both array formulae and need to be entered with Ctrl Shift Enter

  10. #10
    Registered User
    Join Date
    10-07-2014
    Location
    Utah, USA
    MS-Off Ver
    2013
    Posts
    6

    Re: Finding the Earliest and Latest Dates for each Task Code

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    The difference is column A. In the first example these were all numeric values. This latest are all text strings.
    This complicates the formulae somewhat and they need to be changed as follows

    H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    NB. These are both array formulae and need to be entered with Ctrl Shift Enter
    SUCCESS!

    I had to Research array formulas and understand how Ctrl+Shift+Enter worked, but it works great now.

    Thanks for your help and patients,
    Ben

+ 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. Formula - Determining Earliest and Latest dates for a Category of records
    By haleakala17 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2014, 11:35 AM
  2. finding the latest date in a list of dates
    By easty in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-14-2010, 01:34 AM
  3. Earliest and Latest Dates from a list of names?
    By TimMatrix in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2008, 07:34 PM
  4. Counting Dates and Finding Earliest
    By -emma- in forum Excel General
    Replies: 7
    Last Post: 07-24-2007, 05:03 PM
  5. [SOLVED] Finding the Latest Date from Several Dates in Different Columns
    By sdupont in forum Excel General
    Replies: 4
    Last Post: 12-30-2005, 04:55 PM

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