How to Find the Most Common Row or Column Header in Excel
Question details
The user needs to construct formulas that can identify the most frequently occurring row and column headers across multiple tables, ensuring that any tied values are ignored by returning the first match.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing multiple datasets or tables where the user needs to dynamically extract the most common categorical headers (rows or columns) using a formula.
- Observed behavior
- Requires a specific formula combination that returns the highest-frequency text header and defaults to the first occurrence if there is a tie.
Verify that your version of Excel supports the LET function (available in Microsoft 365, Excel 2021, and newer). If you are using an older version, you will need to rely on traditional array formulas.
Use the LET and COUNTIF Formula for Row Headers
Combine LET, COUNTIF, INDEX, and MATCH functions to count the occurrences of your row headers in the dataset and extract the most frequent one.
This formula works by defining variables using the LET function, making it easier to read and faster to calculate. It counts how many times each header appears in the target range and then looks up the one with the maximum count.
Click on the specific cell where you want the most common row header to be displayed.
Type the formula: =LET(l,A3:A12,c,COUNTIF(B1:I83,l),INDEX(l,MATCH(MAX(c),c,FALSE))) into the formula bar.
Modify 'A3:A12' to match your row headers range, and 'B1:I83' to match the data range you are checking against.
Press Enter. The cell will now display the row header that appears most frequently in your specified range.
Use the LET and COUNTIF Formula for Column Headers
Apply a similar formula structure customized for horizontal column headers to find the most common category.
Easily Manage Complex Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like LET, COUNTIF, and INDEX MATCH. It provides a lightweight and highly compatible environment for performing complex data analysis across multiple datasets.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your multiple tables.
- 2. Select the output cell: Click the cell where you want to identify the most common header.
- 3. Enter the formula: Paste the combined LET and COUNTIF formula into the formula bar and adjust the ranges to fit your dataset.
- 4. View the result: Press Enter to instantly calculate the most frequent row or column header.

Frequently Asked Questions
Can I use the MODE function to find the most common text header?
No, the standard MODE or MODE.SNGL function only works with numeric values. Because headers are usually text, you must use a combination of functions like COUNTIF to quantify the text occurrences before finding the maximum value.
What should I do if my version of Excel doesn't support the LET function?
If you are using an older version of Excel that lacks the LET function, you can write out the full formula without variables. For example: =INDEX(A3:A12, MATCH(MAX(COUNTIF(B1:I83, A3:A12)), COUNTIF(B1:I83, A3:A12), 0)). You may need to press Ctrl+Shift+Enter to evaluate it as an array formula.
Why does my formula return a #NAME? error?
The #NAME? error typically occurs if your spreadsheet software does not recognize one of the functions used, most commonly the LET function in older software versions. It can also happen if there is a typo in your function names.
How can I find the second most common header?
To find the second most frequent text item, you can replace the MAX function in your formula with the LARGE function, specifying 2 as the 'k' value: LARGE(c, 2).




