+ Reply to Thread
Results 1 to 10 of 10

Using Max with Index & Match across two arrays of data

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Using Max with Index & Match across two arrays of data

    Hi there,

    I'm trying to show the max amount for the year for each region for either the actual or forecast but am struggling with the basic syntax for finding the max within just the one array, let alone across two different arrays!

    I've attached a sample workbook, and the basic premise for the formula in P2 is such:
    Where the region matches cell O2 across both the named ranges "Act" & "FC", return the maximum value out of Act & FC for that row for the year.

    There's a further twist in there may not be a corresponding lookup value in one of the arrays that matches O2 so it may only be referencing one array...

    Any ideas please???

    Thanks,

    Mike
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Using Max with Index & Match across two arrays of data

    Try this.....

    Please Login or Register  to view this content.
    Please see the attached sheet.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Using Max with Index & Match across two arrays of data

    Hello
    Alternative to sktneer's solution, slightly shorter:

    Please Login or Register  to view this content.
    DBY

  4. #4
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: Using Max with Index & Match across two arrays of data

    Thank you both, both solutions work perfectly!!

    Going to go with DBY's though, as more dynamic and allows movement on the rows and shorter which helps as I will be adding in several more tables of data to reference, thank you.

    Quick follow up question: trying to duplicate this formula to bring back the MIN as well, but it only returns 0 due to the array multiplying out by zero. How could I tweak this so that I can show the MAX and MIN side by side please?

    Thanks as always,

    Mike

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using Max with Index & Match across two arrays of data

    Hi,

    For the equivalent minimum, try this array formula:

    =MIN(IF($A$2:$A$14=O2,IF($B$2:$M$14<>0,$B$2:$M$14)),IF($A$18:$A$29=O2,IF($A$18:$A$29<>0,$B$18:$M$29)))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Using Max with Index & Match across two arrays of data

    Thanks XOR LX for helping out. I was about to reply with a similar array formula. The Index method works great with Max but is difficult with Min as it returns zeros for no match. It could probably be made to work with some adjustments but if your're happy with arrays then it's perhaps the simplest way to go.

    DBY

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using Max with Index & Match across two arrays of data

    Hi DBY,

    I remember spending some time a few weeks ago on a non-array construction with INDEX for finding the minimum, and recall that it is achievable, though the extent of manipulation required to circumvent this zero issue - just to avoid using an array construction! - now seems like more hassle than it's worth.

    It's one of those pecularities that it's so readily achievable with a maximum, but not with the minimum - perhaps Microsoft should consider some sort of "MIN excluding 0" function for their next version!

    Cheers

  8. #8
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: Using Max with Index & Match across two arrays of data

    Hi XOR LX and hi DBY again,

    More than happy to go down the array path and astounded at how simply you've both made this work, saved me a lot of frustration and head-scratching, much appreciated!

    Thanks a million,

    Mike

  9. #9
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Using Max with Index & Match across two arrays of data

    Glad we could help.

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using Max with Index & Match across two arrays of data

    I second that!

+ 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. Index/Match with mulitple arrays
    By Jeannie2006 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2013, 10:56 PM
  2. Sum Index Match Arrays
    By CaesarBob in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-19-2012, 04:38 AM
  3. [SOLVED] Index & Match returning incorrect value. Arrays fixed and exact match used.
    By SDes in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-07-2012, 08:29 PM
  4. referencing arrays in index and match
    By inky in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2007, 07:06 AM
  5. MATCH, INDEX and VLOOKUP with Arrays
    By Dean Hinson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 12:06 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