RANKING.xlsx
May I ask the teacher on the forum,how to deal with the ranking of grades,about class ranking and the total ranking?
RANKING.xlsx
May I ask the teacher on the forum,how to deal with the ranking of grades,about class ranking and the total ranking?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
I am very grateful for your answer.
If I want to write VBA CODE about ranking, hope someone can teach me!
I would use the macro recorder for this; giving you a solution will not "teach you"
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
I mean that I was hoping someone could teach me how to use VBA to solve the problem instead of using "FORMULA".
range("d2:d10").formula="=rank(........)"
range("e2:e10").formula="=sumproduct(.........)"
I wouldn't try to reinvent the wheel.
1. Write the formula while recording a macro
2. Adjust the macro to put the formula in required cells
3. Copy/Paste special the results
If you have problems, post your code.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
It's not that simple:
Sub M_snb() [D2:D10] = [index(rank(C2:C10,C2:C10),)] For j = 1 To 4 [G1] = j [G2:G10] = [if(A2:A10=G1,C2:C10,"")] [E2:E10] = [if(E2:E10="",if(G2:G10="","",rank(G2:G10,G2:G10)),E2:E10)] Next [G1:G10].ClearContents End Sub
Thanks to including mdmackillop, mana, snb, whether it is teaching or to provide solution, because the work just encountered such a ranking problem, for a long time can not be resolved, so I hope to learn some vba skills, if there are impolite, please forgive me.