How to sort list by specific word(s) in Excel?
Sorting string by values is usually used, but have you ever tried to sort strings based on specific word(s)? For example, sorting a list by the number of times a word occurs, as shown in the screenshot below.
Sort by the number of times “apple” and “banana” appear![]() | ![]() | ![]() |
Sort list by specific word(s)
If you want to sort a list by specific word(s), you first need to count how many times those words appear.
1. Select a cell next to the list, type this formula =SUM(--ISNUMBER(SEARCH({"apple","banana"}, A1))). "Apple" and "banana" are the words you want to sort by, press Enter key and drag fill handle over the cells where you want to apply the formul.
2. Keep the formula cells selected, and click Data > Sort A to Z, and check Expand the selection in the Sort Warning dialog.
3. Click Sort, the list will be sorted based on the number of occurrences of “apple” and “banana”.
Related Articles
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!