+ Reply to Thread
Results 1 to 6 of 6

Array formula for TOP 10 - how to deal with duplicate values

Hybrid View

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    77

    Array formula for TOP 10 - how to deal with duplicate values

    Hello all,

    I am using the below formula to give me the Top 10 project numbers based on various criteria, see attached spreadsheet.

    {=INDEX('Current Month'!$A:$AN,MATCH(LARGE(IF('Current Month'!$AM:$AM<>"X",IF('Current Month'!$F:$F=$A$29,IF('Current Month'!$AJ:$AJ="Increase",'Current Month'!$AI:$AI))),$A39),'Current Month'!$AI:$AI,0),1)}

    It is working fine, except for when there are 2 equal values in the source data which have different criteria.

    The problem means the formula returns an incorrect result, the value in the row to match is 200k, and there are 2 rows of 200k in the source data, and the wrong one is first in the list, so this is the one being returned.

    How do I get around this? My guess is to somehow add a very small number to each value, but I'm not sure how to do this.

    Also, I intend to amend the formula to use dynamic ranges in order to reduce memory usage, and will do this when I have sorted this issue out.

    I hope this is clear, thanks for any help!

    Rich
    Attached Files Attached Files
    There must be a quicker way...

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Array formula for TOP 10 - how to deal with duplicate values

    the formula you have posted does not match the sheet names or cell reference's in that workbook
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Array formula for TOP 10 - how to deal with duplicate values

    I have updated the attachment, and it should now match

    Thanks
    Attached Files Attached Files

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

    Re: Array formula for TOP 10 - how to deal with duplicate values

    Hi,

    One way is to repeat the criteria for the lookup_array as well:

    =INDEX('Current Month'!$A:$AN,MATCH(LARGE(IF('Current Month'!$AM:$AM<>"X",IF('Current Month'!$F:$F=$A$29,IF('Current Month'!$AJ:$AJ="Increase",'Current Month'!$AI:$AI))),$A39),IF('Current Month'!$AM:$AM<>"X",IF('Current Month'!$F:$F=$A$29,IF('Current Month'!$AJ:$AJ="Increase",'Current Month'!$AI:$AI))),0),1)

    Regards
    Click * below if this answer helped

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

  5. #5
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Array formula for TOP 10 - how to deal with duplicate values

    I would never have thought of that, thank you very much!

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

    Re: Array formula for TOP 10 - how to deal with duplicate values

    You're welcome.

+ 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 duplicate values within an array
    By amphinomos in forum Excel General
    Replies: 8
    Last Post: 02-13-2014, 10:32 AM
  2. remove duplicate values from array
    By nikko50 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2013, 07:14 PM
  3. Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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