Say you have a list (array of cells containing text) in column A. Entering
the following formula (adusting to the size of your array) in column B will
rank them:
I tested this with the data to be sorted in the range B3:B20.
I used a helper column, where B3 is the first entry of the name range (column) pq. I've named the helper column Hcol.