Hello all.
I have a project Dashboard that needs to refresh the Daily Numbers in order of Order Volume. Then, after I supply the number, I want to application.worksheetfunction.match/index the client associated with that Nth Large number. Only match/index isn't working for me as there are often duplicate results. I need to find the .row that the application.worksheetfunction.large finds.
Simplified Explanation: Daily Order Count is the column I'm doing LARGE on. Using VBA, I want to return both the LARGE (nTH) and the associate Client ID next to it.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Client ID[/TD]
[TD]Daily Order Count[/TD]
[TD]Fee[/TD]
[/TR]
[TR]
[TD]1233[/TD]
[TD]74[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1129[/TD]
[TD]127[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]906[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]389[/TD]
[TD]106[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]821[/TD]
[TD]165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1085[/TD]
[TD]16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1963[/TD]
[TD]70[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1058[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1278[/TD]
[TD]26[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I next use Application.WorksheetFunction.Match/Index on the LARGE and the Results are not as promising on duplicate LARGE entries
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Top Clients in order of Volume[/TD]
[TD]Daily Order Count[/TD]
[TD]Fee[/TD]
[/TR]
[TR]
[TD]821[/TD]
[TD]165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1129[/TD]
[TD]127[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]389[/TD]
[TD]106[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1233[/TD]
[TD]74[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1963[/TD]
[TD]70[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1278[/TD]
[TD]26[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1085[/TD]
[TD]16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The duplicated LARGE(Nth) of 15 is causing the Client ID to return the same row the first 15 is found. Yadda Yadda its not good.
What I have so far that has worked up until this point is this:
The part in red is where the RowNo is returning the incorrect Row Number on results that are duplicated.
There is an Excell ARRAY Formula that can get me the results I want but its very clunky and doesn't translate into VBA very well.
Any help to steer me in the right direction of just finding out the unique RowNo for duplicate match results would be greatly appreciated.
I have a project Dashboard that needs to refresh the Daily Numbers in order of Order Volume. Then, after I supply the number, I want to application.worksheetfunction.match/index the client associated with that Nth Large number. Only match/index isn't working for me as there are often duplicate results. I need to find the .row that the application.worksheetfunction.large finds.
Simplified Explanation: Daily Order Count is the column I'm doing LARGE on. Using VBA, I want to return both the LARGE (nTH) and the associate Client ID next to it.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Client ID[/TD]
[TD]Daily Order Count[/TD]
[TD]Fee[/TD]
[/TR]
[TR]
[TD]1233[/TD]
[TD]74[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1129[/TD]
[TD]127[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]906[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]389[/TD]
[TD]106[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]821[/TD]
[TD]165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1085[/TD]
[TD]16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1963[/TD]
[TD]70[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1058[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1278[/TD]
[TD]26[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I next use Application.WorksheetFunction.Match/Index on the LARGE and the Results are not as promising on duplicate LARGE entries
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Top Clients in order of Volume[/TD]
[TD]Daily Order Count[/TD]
[TD]Fee[/TD]
[/TR]
[TR]
[TD]821[/TD]
[TD]165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1129[/TD]
[TD]127[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]389[/TD]
[TD]106[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1233[/TD]
[TD]74[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1963[/TD]
[TD]70[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1278[/TD]
[TD]26[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1085[/TD]
[TD]16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]716[/TD]
[TD]15[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The duplicated LARGE(Nth) of 15 is causing the Client ID to return the same row the first 15 is found. Yadda Yadda its not good.
What I have so far that has worked up until this point is this:
Code:
lrg = 1
For iRow = 2 To 30
DailyLarge = Application.WorksheetFunction.Large(CurYearSum.Range("F1:F900"), lrg)
[U][COLOR=#ff0000]RowNo = Application.WorksheetFunction.Match(DailyLarge, CurYearSum.Range("F1:F900").Offset(0, cmn), 0)[/COLOR][/U]
[Loop process goes here]
....
lrg = lrg + 1
Next iRow
The part in red is where the RowNo is returning the incorrect Row Number on results that are duplicated.
There is an Excell ARRAY Formula that can get me the results I want but its very clunky and doesn't translate into VBA very well.
Code:
=INDEX(Sheet2!$A$1:$A$900,SMALL(IF(Sheet2!$F$1:$F$900=$B2,ROW(Sheet2!$F$1:$F$900)),COUNTIF($B$2:B2,B2)),1)
Any help to steer me in the right direction of just finding out the unique RowNo for duplicate match results would be greatly appreciated.
Last edited: