+ Reply to Thread
Results 1 to 8 of 8

Finding the most current and previous current date based on multiple criteria

  1. #1
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    104

    Finding the most current and previous current date based on multiple criteria

    Hi pros!

    Quick question, in the attached file, I am trying to get a formula that will identify the most current repair date and then also identify the previous most current repair date for the specific car model.

    There are 3 criteria for each car model so the dates need to be for that specific combination. I inserted in column F the expected results I would like the formula to generate.

    I am not sure where to start with the formula. Would any of you be able to help?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Finding the most current and previous current date based on multiple criteria

    Here is one way...

    Being that this is going to use a match to find the last date, you will need to sort your order in Descending order (TIME) also need to make sure your dates are values and not text as you have them in your current shared file.

    Array - So you will need to hit CTRL+SHIFT+ENTER to apply the formula
    Please Login or Register  to view this content.
    Cheers
    -If you think you are done, Start over - ELeGault

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Finding the most current and previous current date based on multiple criteria

    Here is another array entered formula* solution which doesn't require sorting, but does require that dates be dates as opposed to text (use the text to columns method):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formula are activated by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Finding the most current and previous current date based on multiple criteria

    As your dates are in Text format, so you can use this array formula :
    Please Login or Register  to view this content.
    Or,
    Please Login or Register  to view this content.
    Confirm Ctrl+Shift+Enter
    Last edited by sanram; 09-23-2016 at 05:37 PM.

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Finding the most current and previous current date based on multiple criteria

    Try this ...

    =LOOKUP(SUMPRODUCT((A$2:A$38=A2)*(B$2:B$38=B2)*(C$2:C$38=C2)*(D$2:D$38=D2)*(E$2:E$38-E2>0))+1,{1,2,3},{"Current","Previous",""})

    Or

    =LOOKUP(COUNTIFS(A$2:A$38,A2,B$2:B$38,B2,C$2:C$38,C2,D$2:D$38,D2,E$2:E$38,">"&E2)+1,{1,2,3},{"Current","Previous",""})
    Last edited by Phuocam; 09-23-2016 at 08:04 PM.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding the most current and previous current date based on multiple criteria

    Try this solution (cars can be any order):

    Please Login or Register  to view this content.
    Quang PT

  7. #7
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    104

    Re: Finding the most current and previous current date based on multiple criteria

    Perfect! Thank you all!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Finding the most current and previous current date based on multiple criteria

    You're Welcome, thank you for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month
    By AK123 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2016, 01:10 PM
  2. Date Autofilter- Previous months up to current
    By dw_22801 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2015, 06:50 PM
  3. [SOLVED] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  4. Replies: 1
    Last Post: 04-29-2014, 09:06 PM
  5. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  6. Replies: 11
    Last Post: 07-01-2012, 03:51 AM
  7. Replies: 4
    Last Post: 03-21-2011, 05:37 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