+ Reply to Thread
Results 1 to 10 of 10

Combining INDEX and MATCH with MAX

  1. #1
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Question Combining INDEX and MATCH with MAX

    I have an existing spreadsheet with single row entries e.g. James, Jim, Tom (column R) and then some data for each (column P). My current formula that works is: INDEX('Sheet 1'!$P:$P,MATCH($A2,'Sheet 1'!$R:$R,0))

    Now I have a slightly different spreadsheet with multiple row entries for James, Jim and Tom, with different data. My question is where in the existing formula do I tell it to just return the largest value for James, Jim, Tom out of all the entries? I tried MAX(INDEX('Sheet 1'!$P:$P,MATCH($A2,'Sheet 1'!$R:$R,0))) but that did not work.

    Many thanks
    Last edited by jcswaby; 02-12-2016 at 10:24 AM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining INDEX and MATCH with MAX

    Maybe something like this...

    Array entered**:

    =MAX(IF('Sheet 1'!R2:R100=A2,'Sheet 1'!P2:P100))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    If that's not even close then we'll need to see some sample data along with your expected result.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Combining INDEX and MATCH with MAX

    One way

    =MAX(IF($R$2:$R$1000="James",$P$2:$P$1000,""))

    Enter with Ctrl+Shift+Enter

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Combining INDEX and MATCH with MAX

    or a non array formula with just ENTER-
    Please Login or Register  to view this content.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  5. #5
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Post Re: Combining INDEX and MATCH with MAX

    Here's a snapshot of the data, basically the max value for Tom is 34664, Jim is 34564 and James is 435 and those entires should be displayed in B2:B4 on Sheet2.

    Many thanks for your help guys.
    Attached Files Attached Files

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Combining INDEX and MATCH with MAX

    In B2-
    Please Login or Register  to view this content.
    copied down..

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining INDEX and MATCH with MAX

    This array formula** entered in B2 and copied down:

    =MAX(IF(Sheet1!R$1:R$38=A2,Sheet1!P$1:P$38))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining INDEX and MATCH with MAX

    Quote Originally Posted by sourabhg98 View Post
    =SUMPRODUCT(MAX((Sheet1!R:R=$A2)*Sheet1!P:P))
    You should avoid using entire columns as range references in the SUMPRODUCT function.

    SUMPRODUCT will evaluate EVERY cell referenced. If you have 990,000 empty cells per column you're wasting resources by having to evaluate all those empty cells.

  9. #9
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Re: Combining INDEX and MATCH with MAX

    Perfect, it works now, I think I just completely over complicated it originally!

    Many thanks everyone.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining INDEX and MATCH with MAX

    You're welcome. Thanks for the feedback!

+ 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. Combining Index Match and max functions
    By ifu06416 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-29-2015, 02:48 AM
  2. [SOLVED] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  3. [SOLVED] Combining Index, Match, If, Not, ISERROR
    By brad999 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-07-2013, 07:02 AM
  4. [SOLVED] Need help combining two Index Match functions into one
    By BeachRock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-23-2012, 10:35 PM
  5. Combining Index & Match Functions
    By bmc1975 in forum Excel General
    Replies: 7
    Last Post: 10-28-2010, 11:04 AM
  6. Combining Match & Index Functions
    By bmc1975 in forum Excel General
    Replies: 10
    Last Post: 08-09-2010, 03:33 PM
  7. Combining SUMPRODUCT and INDEX/MATCH??
    By Steve_Courts in forum Excel General
    Replies: 1
    Last Post: 10-08-2009, 04:05 AM

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