+ Reply to Thread
Results 1 to 4 of 4

Building calculations based on dates identified based on 2 other criteria

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

    Building calculations based on dates identified based on 2 other criteria

    Hello all! Hope that you can help.

    I’m trying to build a formula that will identify the latest date in a list of unsorted data. The date is dependent on 2 other values.

    Here is an example:

    Date….......…….Department……….Flag
    1/1/2010……….Department A……….Y
    1/6/2010……….Department A……….N
    1/3/2010……….Department B……….Y
    1/10/2010……..Department A……….Y

    I need to display the latest date for each department where the flag is Y.

    Once this is figured out, I must also calculate the number of dates between that latest date for each department and another date on the sheet.

    Any thoughts?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Building calculations based on dates identified based on 2 other criteria

    You can determine the MAX date using a MAX Array, ie:

    =MAX(IF(($B$2:$B$5="Department A")*($C$2:$C$5="Y"),$A$2:$A$5))
    confirmed with CTRL + SHIFT + ENTER

    "Department A" can be replaced by a cell reference containing value of interest

    (the above could be achieved with a Pivot Table of course)

    As for your other question - we would need more info. but given use of XL2007 you should find COUNTIFS will do what you want.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Building calculations based on dates identified based on 2 other criteria

    But is the last data max data too?

    Looking at the example I wouldn't say so because 1/3 is after 1/6...

    Althought, it's for other department...
    Last edited by zbor; 03-03-2010 at 11:04 AM.

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

    Re: Building calculations based on dates identified based on 2 other criteria

    Actually, the pivot table turned out to be the right choice. Don't know why I didn't do that earlier.

    Here is a new twist on the question though. I need to look back into the past to find the largest gap between dates in the data for events that have the Y flag, for each individual department. I need to present the longest departmental streaks that have occured in the data set, and compare it to the current streak that this pivot table helps me to define.

    Defining the current current streak is pretty easy as the calculations are based on a single date field that I enter. Defining the longest previous streak is proving much more challenging, as I'm looking back at the entire dataset. Also remember that the data is not sorted in date order. I prefer to keep it that way because I hope to avoid adding additional steps in my download and analysis process.

    My head hurts.
    Last edited by SeanMulholland; 03-04-2010 at 01:13 PM.

+ 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