+ Reply to Thread
Results 1 to 6 of 6

Return Max with multiple criteria including date - array?

  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    Livermore, CA
    MS-Off Ver
    Office 2013 - Windows
    Posts
    3

    Return Max with multiple criteria including date - array?

    Hello all,
    I'm sure that there's an easy answer to my problem but for the likes of me I can't figure it out. I'm crunching some data and could use a bit of help here.

    I have 4 columns: EmployeeID, Classification, DateofHire, Salary
    I want to create a formula that returns the highest salary of a person in a classification that was hired after the employee in question.

    Here are the results I'd like to see for the entries below:

    3100
    0
    3200
    0
    3200
    0

    EmployeeID,Classification,DateofHire,Salary
    1,janitor,1/1/2002,3000
    2,cook,2/1/2002,2500
    3,maid,3/1/2002,2600
    4,janitor,4/1/2002,3100
    5,maid,5/1/2002,2800
    6,maid,6/2/2002,3200


    I was trying to create an array using the formula: =MAX(IF(B2:B7,=B2,If(C2:C7>C2),D2:D7))


    If my explanation doesn't make sense please let me know and I can try again.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Return Max with multiple criteria including date - array?

    Well, you've actually got a comma and a closed bracket in the wrong place there. Try it like this:

    =MAX(IF((B2:B7=B2)*(C2:C7>C2),D2:D7))

    Use CSE to commit the formula.

    Note: the * is equivalent to AND for arrays, so you can join multiple conditions in that way.

    Hope this helps.

    Pete

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

    Re: Return Max with multiple criteria including date - array?

    Or try this ...

    =AGGREGATE(14,6,D2:D7/(B2:B7=B2)/(C2:C7>C2),1)

    Normal enter.

  4. #4
    Registered User
    Join Date
    07-13-2016
    Location
    Livermore, CA
    MS-Off Ver
    Office 2013 - Windows
    Posts
    3

    Re: Return Max with multiple criteria including date - array?

    Thanks Pete!!!

    This looks to be on the right track. Any ideas on how to lock down the ranges? It looks like it's moving up by 1 every time I drag it down . I tried using the $ to lock down the formula to a specific cell but it kills the process.

    This is important because there's no direct correlation to when people were hired and what classification they're in.

    Thanks,
    Andy

  5. #5
    Registered User
    Join Date
    07-13-2016
    Location
    Livermore, CA
    MS-Off Ver
    Office 2013 - Windows
    Posts
    3

    Re: Return Max with multiple criteria including date - array?

    Phuocam - Works like a champ from what I can see right now because I know how to lock in the range with this method. I need to do a random spot check of the 15,000 employee entries I have, but on the surface it looks great!

    1 question though, the last option selected, the ",1"; what does that indicate?

    Thanks,
    Andy

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Return Max with multiple criteria including date - array?

    You should be able to do this:

    =MAX(IF((B$2:B$7=B2)*(C$2:C$7>C2),D$2:D$7))

    if you want to copy the formula down. Again, use CSE to commit.

    Hope this helps.

    Pete

+ 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] Count and sum with multiple criteria including date range
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-23-2016, 04:46 PM
  2. [SOLVED] Formula to return multiple criteria including a stretch target.
    By NeroM in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-09-2014, 06:05 AM
  3. SUMIFS or SUMPRODUCT with multiple criteria including date ranges
    By baxcat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2013, 09:40 AM
  4. Looking for last entry using multiple criteria including date
    By ayrmad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2013, 11:36 PM
  5. [SOLVED] Multiple criteria lookup including recent date.
    By Dimydom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-29-2012, 06:43 AM
  6. Replies: 5
    Last Post: 05-23-2011, 12:04 PM
  7. Using array to sum by multiple criteria including one based on prefix
    By monkdelafunk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-29-2008, 02:24 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