The ranking is placed first because, for some mysterious reason, RANK requires range references and not arrays. The next row is a device to combine the newly calculated rankings with the text column before it is sorted by rank.
Bazz02 Depending on your needs and below assuming Excel 365, it can be done in multiple ways and without a macro-button.
Having data in a (pyamas) table you can calculate the rank using a column formula =XMATCH([@Value];SORT([Value])) ...finding the value on the same row (@ = single cell intersection) among all values sorted, and returning the number of the first match.
You may sort that column using the arrow in cell C2
Since it is an interesting education example I added some more solutions outside the table;
Cell E3 sorts the table each time data changes. It is a formula in only one cell but it 'spills' the result to as many cells that are needed.
=SORT(Table1[[Text]:[Value]];2)
G3 isolates the percentages in F3:F8 by addressing E3# (includes the full spill area) and intersects it with column F using the multiple cell intersection character space. =XMATCH(E3# F:F;E3# F:F)
If you need to redesign the layout, it may be more handy to not include a column reference and then INDEX is a solution where row number zero returns all the rows and the two tells the second col. =XMATCH(INDEX(E3#;0;2);INDEX(E3#;0;2))
LET is yet a rather new possibility to build a complex formula step by step. Use alt+Return for line breaks. The last row/parameter is what is shown as the output of the calculation. =LET(range;Table1[Value]; data;SORT(range); output;XMATCH(data;data); output )