Soniya ranks 26th in the class.
Sonam is 8 ranks ahead of Soniya, meaning Sonam has a better rank (lower rank number).
Sonam's rank from the top:
Sonam’s rank=26−8=18
The class has 45 students in total.
For a student at rank r from the top in a class of n students, the rank from the last is given by:
Rank from last=n−r+1
Sonam's rank from the last:
Rank from last=45−18+1
Rank from last=28
Therefore, Sonam's rank from the last is 28.