+ Reply to Thread
Results 1 to 7 of 7

Find latest date in excel based on multiple conditions

  1. #1
    Registered User
    Join Date
    10-08-2024
    Location
    United States
    MS-Off Ver
    2016
    Posts
    2

    Find latest date in excel based on multiple conditions

    I need to figure out a formula or pivot table show me if the Open test date is the most recent date in a table. So this is for a table of test types, each having multiple occurences on the report. I need to determine if the Open test was ordered more recently than the tests done. I've set up the 3 scenarios here. The ABC test has the open one with the most recent date. The LMN one the open date is between two closed ones. The QRS one has both the closed ones with more recent dates than the open one. XYZ has two open orders, neither are the most recent. Testing Example.xlsx

    Test Date Done NEED
    ABC 8/1/2024 Open Most Recent
    ABC 7/1/2024 Closed
    ABC 6/1/2024 Closed
    LMN 2/2/2024 Closed
    LMN 3/2/2024 Open No
    LMN 4/2/2024 Closed
    QRS 9/3/2024 Closed
    QRS 7/3/2024 Closed
    QRS 5/3/2024 Open No
    XYZ 1/4/2021 Open No
    XYZ 5/3/2021 Closed
    XYZ 7/7/2021 Open No
    XYZ 9/12/2021 Closed

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Find latest date in excel based on multiple conditions

    Welcome to the Forum mk0410!

    This probably needs an array formula (might also be solved with SUMPRODUCT).

    In D2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is an array formula. After typing in the formula, do not hit ENTER--hit CTRL+SHIFT+ENTER. You have done it correctly if the formula in the formula box has {braces} around it. You cannot type in the braces; they are just an indicator that it is an array formula.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,999

    Re: Find latest date in excel based on multiple conditions

    D2=IF($C2<>"",IF(C2="Closed","",IF(B2=AGGREGATE(14,6,$B$2:$B$14/($C$2:$C$14="Open"),1),"Most Recent","No")),"")

    Copy down

  4. #4
    Registered User
    Join Date
    10-08-2024
    Location
    United States
    MS-Off Ver
    2016
    Posts
    2

    Re: Find latest date in excel based on multiple conditions

    Is there a way to write this formula so you could compare just the values in the A column if they are the same? So get the most recent date of all the ABCs, then the most recent date for the LMNs, etc.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Find latest date in excel based on multiple conditions

    Please revise the sample result in your file so we can understand what you're after.

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Find latest date in excel based on multiple conditions

    Try, =IF(C2="Closed","",IF(AGGREGATE(14,6,$B$2:$B$14/($A$2:$A$14=A2),1)=B2,"Most Recent","No"))

  7. #7
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,999

    Re: Find latest date in excel based on multiple conditions

    H2=IFERROR(INDEX($A$2:$A$100,SMALL(IF(FREQUENCY(IF($A$2:$A$100<>"",MATCH($A$2:$A$100,$A$2:$A$100,0)),ROW($A$2:$A$100)-ROW($A$2)+1),ROW(A2:A100)-ROW($A$2)+1),ROWS($A$1:A1))),"")

    Control+shift+enter

    copy down

    I2=IF($F$1="all",IFERROR(AGGREGATE(14,6,$B$2:$B$100/($A$2:$A$100=H2)/($B$2:$B$100<>""),1),""),IFERROR(AGGREGATE(14,6,$B$2:$B$100/($A$2:$A$100=H2)/($C$2:$C$100=$F$1)/($B$2:$B$100<>""),1),""))

    Copy down

    select with drop down list in F1 ALL(Open and Closed) or Open , Closet
    Attached Files Attached Files

+ 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] Finding the Latest Date Based on Conditions
    By bafi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2021, 02:03 PM
  2. Find earliest and latest time based on specific date
    By klturi421 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2019, 11:20 PM
  3. find the latest row based on ID and date submitted
    By yaksh420 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-20-2018, 10:47 AM
  4. [SOLVED] Find the latest price based on the date
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2016, 01:03 PM
  5. [SOLVED] Lookup the date and return the latest value under some conditions from multiple columns
    By PMH2384 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-09-2016, 03:31 AM
  6. [SOLVED] find latest purchase date from multiple sheets
    By leprince2007 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 10-12-2015, 02:44 AM
  7. [SOLVED] Find latest date when the name appeared either formula or vba multiple sheets
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2014, 08:24 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