Search code examples
excelexcel-formuladuplicatesunique-id

Retrieve the most duplicated value for a specific Data


I am having difficulties programming this idea.

As you can see here in this sheet, ID no: 9999999 is the most ID listed in front of the documents mismatch. Which mean ID no: 9999999 is the most one making this type of mistake. In the other hand, ID number : 8888888 also is the most one making this mistake (wrong address).

enter image description here

So, what i want is when i type documents mismatch, ID no 9999999 should be retrieved.
Thank you.


Solution

  • Formula in H2:

    =INDEX($A$2:$A$10,MATCH(MAX(COUNTIFS($A$2:$A$10,$A$2:$A$10,$B$2:$B$10,G2)),COUNTIFS($A$2:$A$10,$A$2:$A$10,$B$2:$B$10,G2),0))
    

    Note: As this is an array formula, enter it through pressing CtrlShiftEnter

    Drag down.