• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Rank based on Condition while avoid duplicates (ties)

oappleq

New Member
Hi and thank you,

I'm trying to create a dynamic top ten list of units by department. I created the appropriate index(match) formula to create the list. The index(match) formula relies on providing a unique rank for the products in a specific department. The list will change as selling periods progress. The data originates from our SAP server and pulled into Excel via Analysis for Office add-on.

Using =rank(K3,$K$3:$K$706)+countif($K$3:$K3,K3)-1 I return the rank for all product regardless of department in column I while avoiding duplicate ranks, i.e. overall top ten. There is only one 1 in column I. Column D contains the department name and Column K contains the total units sold (values from which I base the rank).

Using ={sumproduct(($D$3:$D$706=D3)*(K3<$K$3:$K$706))+1} in column J, I can rank the units (column K) by department (column D), i.e. top ten for each department, etc, in column J.

The problem arises that this formula repeats ranks if two values are identical. I've sorted the data in the upload file by columns D (Department) then J (rank within Department) so I could run an error check. There are quite a few occurrences where a rank was duplicated.

The data cannot be sorted prior to determining the rank. Nor is adding a helper column an option. Lastly, I don't use VBA. Any suggestions for a formula would be appreciated.

Thanks.
 

Attachments

  • Chandoo Uploadt.xlsx
    40.2 KB · Views: 6
Hi oappleq,

You can use Deduplicated method to add 0.000001 to avoid duplicacy.

Copy =J3+0.000001*ROWS($J$3:J3) in L3

Please check attached file.

Regards,
AM:)
 

Attachments

  • Rank based on Condition while avoid duplicates (ties)2.xlsx
    52.7 KB · Views: 2
Hi Ashish,

Thanks for your reply. While I appreciate your suggestion, adding a helper column isn't possible.

Oappleq
 
Hi ,

Is it possible to have a clear explanation of what you want , without any reference to what you have tried ?

Narayan
 
Dear Oappleq,

Adding to Narayan Sir.

Also, mention the constraints like the one you revert back Helper Column not possible.

Regards,
AM:)
 
Back
Top