Get rank based on priority