I want to RANK students' position in class according to their "Total Mark"
in Column AN.
I use the following formula to do the ranking.

=RANK($AN$7:$AN$56,$AN$7:$AN$56)

If the "Total Mark" is the same for two or more students, then RANKING must
now be based on their 'Grade Point Average' which is listed in in Column AM.

If the 'Grade Point Average' is also the same, the rank should now be based
on marks the students score for COURSE A in Column AL.

Can someone suggest a formula for that?

Thank you in advance.