# Sorting in descending order of list [closed]

I have a list

m = {{a, 20}, {b, 10}, {c, 50}, {d, 5}, {e, 100}}


and I want to apply Sort on this in descending order on numbers only so that it looks like this

m = {{e, 100}, {c, 50}, {a, 20}, {b, 10}, {d, 5}}


How do I do that?

• Take a look at SortBy. – Kuba Oct 14 '15 at 15:38
• SortBy[m,Last] – IPoiler Oct 14 '15 at 15:39
• Greetings! To make the most of Mma.SE please take the tour now. Help us to help you, write an excellent question. Edit if improvable, show due diligence, give brief context, include minimum working examples of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. – rhermans Oct 14 '15 at 15:41
• Your question may be put on-hold as it seems to be off-topic, i.e it is easily found in the documentation and is unlikely to help any future visitors. Don't be discouraged by that cleaning-up policy. Your future good questions are welcome. Learn about common pitfalls here. – rhermans Oct 14 '15 at 15:47

## Data

m = {{a, 20}, {b, 10}, {c, 50}, {d, 5} , {e, 100}}


## Code

Reverse[SortBy[m, Last]]


or

SortBy[m, Minus@*Last]


or since Mathematica v12

ReverseSortBy[Last][m]

{{e, 100}, {c, 50}, {a, 20}, {b, 10}, {d, 5}}


Where @* stands for Composition