Find the Most Frequent Text Value in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
MODE only works on numbers, so for the most frequent text in Excel you turn each value into a position first: =INDEX(B2:B8,MODE(MATCH(B2:B8,B2:B8,0))). MATCH gives each item's first position, MODE finds the most common position and INDEX returns the text there. =INDEX(B2:B8,MATCH(MAX(COUNTIF(B2:B8,B2:B8)),COUNTIF(B2:B8,B2:B8),0)) does the same with COUNTIF.
Key takeaways
- MODE ignores text, so you can't use =MODE(B2:B8) on words.
- =INDEX(range,MODE(MATCH(range,range,0))) returns the text that appears most often.
- MAX(COUNTIF(range,range)) tells you how many times the winner appears.
- When two values tie, these formulas return the one that appears first in the list.
On this page+
- Why MODE doesn't work on text
- How to find the most frequent text with INDEX, MODE and MATCH
- How to find the most frequent text with COUNTIF and MAX
- A Microsoft 365 version with UNIQUE and SORTBY
- How to find the most frequent text with a pivot table
- How to find the most frequent text for one condition
- What happens with ties, blanks and no repeats
- Practise it
To find the most frequent text in Excel, you can't use MODE on its own, because MODE only works with numbers. The fix is to turn each text value into a number first, with MATCH, and then let MODE and INDEX do the rest. This guide shows that formula, a COUNTIF alternative that also gives the count, a Microsoft 365 version, and how to handle ties, blanks and conditions.
Why MODE doesn't work on text#
MODE returns the most common number in a range, and it ignores text. On a column of words, it finds no numbers at all and returns #N/A. The guide to MEDIAN and MODE covers MODE on numbers.
All the examples use this support-ticket list in A1:B8:
| A | B | |
|---|---|---|
| 1 | Agent | Category |
| 2 | Sara | Billing |
| 3 | Jamal | Login |
| 4 | Sara | Shipping |
| 5 | Wei | Login |
| 6 | Sara | Billing |
| 7 | Jamal | Login |
| 8 | Wei | Refund |
Login appears three times, Billing twice, and Shipping and Refund once each. The answer we want is Login.
How to find the most frequent text with INDEX, MODE and MATCH#
This classic formula works in every version of Excel:
=INDEX(B2:B8,MODE(MATCH(B2:B8,B2:B8,0)))It works from the inside out:
| Step | Formula part | Result on the sample data |
|---|---|---|
| 1 | MATCH(B2:B8,B2:B8,0) | Each value's first position: {1;2;3;2;1;2;7} |
| 2 | MODE(...) | The most common position: 2 |
| 3 | INDEX(B2:B8,2) | The text in position 2: Login |
The trick is step 1. MATCH looks up every category in the same list and returns where it first appears. Every Login becomes 2 and every Billing becomes 1, so the text is now numbers MODE can count. The guide to the MATCH function explains the 0 at the end, which asks for an exact match.
In Microsoft 365 and Excel 2021, press Enter as normal. In Excel 2019 and older, confirm the formula with Ctrl+Shift+Enter (Mac: ⌘⇧Return) so Excel treats it as an array formula; Excel then shows it in curly braces { }.
How to find the most frequent text with COUNTIF and MAX#
The COUNTIF version is longer, but each part is easier to check, and it gives you the count as well:
=INDEX(B2:B8,MATCH(MAX(COUNTIF(B2:B8,B2:B8)),COUNTIF(B2:B8,B2:B8),0))| Part | What it does | Result |
|---|---|---|
COUNTIF(B2:B8,B2:B8) | Counts how often each row's value appears | {2;3;1;3;2;3;1} |
MAX(...) | The highest count | 3 |
MATCH(3, counts, 0) | The first row with that count | 2 |
INDEX(B2:B8,2) | The text in that row | Login |
To see how many times the winner appears, use just the middle part:
=MAX(COUNTIF(B2:B8,B2:B8))That returns 3. The COUNTIF function guide and the article on counting duplicates show more ways to count repeated values. For how INDEX and MATCH combine in general, see INDEX MATCH explained, plus the INDEX function guide and MATCH function guide.
A Microsoft 365 version with UNIQUE and SORTBY#
In Excel 2021 or Microsoft 365, you can build a ranked list of categories by count and take the first:
=INDEX(SORTBY(UNIQUE(B2:B8),COUNTIF(B2:B8,UNIQUE(B2:B8)),-1),1)UNIQUE lists each category once, COUNTIF counts each one, and SORTBY puts them in descending order (the -1). INDEX takes the first item: Login. Change the final 1 to 2 to get the second most frequent value, Billing.
To see the whole frequency table, type =UNIQUE(B2:B8) in D2 and =COUNTIF(B2:B8,D2#) in E2. The # refers to the whole spilled list. The guide to counting by category shows the pivot table way to do the same.
How to find the most frequent text with a pivot table#
If you'd rather not write a formula, a pivot table gives you every count at once, and works in all versions:
- Click any cell in the list and choose Insert > PivotTable, then OK.
- Drag Category into Rows.
- Drag Category again into Values. Because it is text, Excel shows Count of Category.
- Right-click any count and choose Sort > Sort Largest to Smallest.
The top row is the most frequent value: Login, with 3. A pivot table doesn't update by itself, so right-click it and choose Refresh after the data changes. Use the formulas when the answer must update automatically.
How to find the most frequent text for one condition#
To find the most common category for one agent, add IF inside MODE so that only that agent's rows count:
=INDEX(B2:B8,MODE(IF(A2:A8="Sara",MATCH(B2:B8,B2:B8,0))))IF returns a position for Sara's rows and FALSE for everyone else's. MODE ignores FALSE, so it only counts Sara's tickets. The result is Billing, which Sara has twice. In Excel 2019 or older, confirm with Ctrl+Shift+Enter.
What happens with ties, blanks and no repeats#
These three edge cases catch people out:
- Ties. If two values appear the same number of times, every formula here returns the one that appears first in the list. With Billing, Login, Login, Billing, the answer is Billing. If ties matter, show the counts with the frequency table so readers can see them.
- Blank cells. An empty cell inside the range can make the MODE and MATCH version return #N/A. Keep the range to filled rows, or skip blanks with IF:
=INDEX(B2:B20,MODE(IF(B2:B20<>"",MATCH(B2:B20,B2:B20,0)))). - No repeats. If every value appears once, MODE has no most common number and returns #N/A. The COUNTIF version returns the first item instead. Wrap the MODE version in IFERROR to show a message:
=IFERROR(INDEX(B2:B8,MODE(MATCH(B2:B8,B2:B8,0))),"No repeats").
Extra spaces also split one value into two. "Login" and "Login " count separately, so clean the column with TRIM if the data was typed by hand or imported.
Practise it#
These formulas combine three skills: counting, finding a position and returning a value. Practise INDEX and MATCH in a live spreadsheet: you type each formula and it checks it instantly. Then practise MEDIAN and MODE to see how MODE treats numbers, and practise COUNTIF to build the frequency counts behind the second method.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Which ticket category comes up most often? In D2, return the most frequent text in B2:B8 with INDEX, MODE and MATCH, then press Enter.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Category | ||||
| 2 | Most frequent | ||||
| 3 | Login | ||||
| 4 | Shipping | ||||
| 5 | Login | ||||
| 6 | Billing | ||||
| 7 | Login | ||||
| 8 | Refund | ||||
| 9 | |||||
| 10 | |||||
| 11 |
Tip: Work from the inside out: MATCH(B2:B8,B2:B8,0), then MODE of that, then INDEX(B2:B8, ...).
Practise this in a lesson
Frequently asked questions
How do I find the most common text in a column in Excel?
Use =INDEX(B2:B100,MODE(MATCH(B2:B100,B2:B100,0))). It returns the text value that appears most often. In Excel 2019 or older, confirm it with Ctrl+Shift+Enter.
Why does MODE return #N/A on text?
MODE only counts numbers and ignores text, so on a column of words it finds no numbers and returns #N/A. Convert the text to positions with MATCH first, then use MODE on those.
How do I find the second most frequent text value?
In Microsoft 365, sort the unique values by their counts and take the second: =INDEX(SORTBY(UNIQUE(B2:B8),COUNTIF(B2:B8,UNIQUE(B2:B8)),-1),2). In older versions, a pivot table sorted by count is the simplest way.
How many times does the most frequent value appear?
Use =MAX(COUNTIF(B2:B8,B2:B8)). COUNTIF counts each item, and MAX picks the largest count. You can also wrap the winning text in COUNTIF: =COUNTIF(B2:B8,D2).