How to find the second most common/frequent number or text in Excel?
In daily work with Excel, you might often need to identify not just the most frequently occurring value in a list or column, but also the second most common one. This scenario may happen when analyzing survey results, product sales, repeated entries, or when you want deeper insights beyond the most obvious trend. While using the native MODE function is a quick way to return the most frequent number, it does not provide a direct method for identifying the second most frequent value. Additionally, if you're dealing with text values or a mixture of both text and numbers, the process can become more complicated. Here, we summarize several practical approaches—each with different strengths, limitations, and applicable scenarios—to efficiently find the second most common value in an Excel list or table.
- Find the second most common/frequent number with an array formula
- Find the second most common/frequent number or text with a helper column
- Find the second most common/frequent number or text with sorting by frequency
- Find the second most common/frequent number or text using VBA code
- Find the second most common/frequent number or text using Pivot Table
Find the second most common/frequent number with an array formula
This solution leverages an array formula to identify the second most common number in a specified range. Array formulas are suitable when you want a direct result with a single formula, but they only work reliably for numeric values. For text values, a different method is required. Note that array formulas may require Ctrl + Shift + Enter (instead of just Enter) depending on your Excel version (pre-Office 365 and Excel 2019).
Select a blank cell where you want the result to be displayed. Type the following formula:
=MODE(IF(A2:A31<>MODE(A2:A31),A2:A31,"")) Press Ctrl + Shift + Enter at the same time to confirm the formula. Upon successful entry, Excel will automatically add curly braces around the formula, indicating that it's been entered as an array formula.

The second most common or frequent number from your range will then appear in the cell. This approach is efficient for numeric lists but does not work for text values, nor does it account for unique tie-breaking logic if several values have the same frequency.

Tips & Notes: Double-check that your range (A2:A31 in the example) matches your actual data. If there are less than two unique numbers in the list, this formula may return either an error or unexpected results. Also, if working with Office 365 or Excel 2019 or newer, you may be able to use dynamic array formulas and just press Enter.
Find the second most common/frequent number or text with a helper column
This method will guide you to batch count the occurrences of each item which you will find out the second common or frequent items from by the Advanced Combine Rows utility of Kutools for Excel, and then sort the occurrences to find out the second most common/frequent text value.
1. Highlight the text or number column you want to analyze, plus a blank adjacent column for marking occurrences. Then go to Kutools > Content > Advanced Combine Rows.
Note: For clarity, assign a header to the helper column such as "Occurrence".
2. In the Advanced Combine Rows dialog box, set your chosen column as the Primary Key, and in the helper column, set it up to Count occurrences. Click Ok to confirm.
3. Select the column displaying the occurrence numbers, then go to Data > Sort Largest to Smallest to arrange the values by their frequency descending.
4. If a Sort Warning appears, make sure to choose Expand the selection and click Sort. This will organize your rows so the second most common item appears on the third row.
Advantages: This method is excellent for both text and numbers, and allows you to check not only the second but also third, fourth, etc. most common values.
Find the second most common/frequent number or text with sorting by frequency
Sorting values by frequency using built-in tools or add-ins such as Kutools for Excel is one of the simplest and most visual methods to find the second most frequent value, especially when working with large datasets.
1. Select your target data column, then open Enterprise > Advanced Sort.
2. Configure the Advanced Sort dialog: pick your column from the Column drop-down, set Frequency as the criterion to sort by, and set the order to Z to A.
3. Click OK. The values are quickly sorted from most to least frequent, so you can straightforwardly identify the second most common value by looking at the sorted list. This method works seamlessly for both numbers and text, simplifies comparison, and requires no formulas.
Find the second most common/frequent number or text using VBA code
For users who prefer automating repetitive tasks or wish to avoid manual setup, a custom VBA macro can efficiently return the second most frequent value from any range, regardless if it contains numbers, text, or a combination. VBA solutions are especially practical if you need to apply this analysis regularly across different worksheets, or prefer not to use helper columns.
1. On the Excel ribbon, click Developer Tools > Visual Basic. In the newly opened Microsoft Visual Basic for Applications window, choose Insert > Module, then copy and paste the code below into the module:
Sub SecondMostFrequentValue()
Dim dict As Object
Dim rng As Range
Dim cell As Range
Dim freqArr As Variant
Dim i As Integer
Dim j As Integer
Dim keyArr As Variant
Dim tempF As Variant
Dim tempK As Variant
Set dict = CreateObject("Scripting.Dictionary")
xTitleId = "KutoolsforExcel"
On Error Resume Next
Set rng = Application.Selection
Set rng = Application.InputBox("Range", xTitleId, rng.Address, Type:=8)
On Error GoTo 0
If rng Is Nothing Then Exit Sub
For Each cell In rng
If Not IsEmpty(cell.Value) Then
dict(cell.Value) = dict(cell.Value) + 1
End If
Next
If dict.Count < 2 Then
MsgBox "Not enough unique values.", vbExclamation, xTitleId
Exit Sub
End If
freqArr = dict.Items
keyArr = dict.Keys
For i = 0 To dict.Count - 2
For j = i + 1 To dict.Count - 1
If freqArr(j) > freqArr(i) Then
tempF = freqArr(i)
tempK = keyArr(i)
freqArr(i) = freqArr(j)
keyArr(i) = keyArr(j)
freqArr(j) = tempF
keyArr(j) = tempK
End If
Next j
Next i
MsgBox "Second most frequent value: " & keyArr(1) & vbCrLf & "Times: " & freqArr(1), vbInformation, xTitleId
End Sub 2. Click the
button (the green triangle) to execute. A dialog box will prompt you to select your target range. Select your data and confirm, after which the second most frequent value along with its occurrence count will be displayed.
Find the second most common/frequent number or text using Pivot Table
A Pivot Table is a highly flexible and user-friendly way to summarize and analyze large datasets in Excel. It allows you to count occurrences of each value, sort them, and quickly locate the first, second, or even third most common value, regardless of whether your data is numeric or text. This method is ideal for users who prefer built-in Excel features without entering formulas or using add-ins.
1. Select any cell in your dataset, then click Insert > Pivot Table. In the dialog, set your desired range and choose where to place the Pivot Table (e.g., a new worksheet).
2. Drag your data column (e.g., “Product Name” or “Values”) into both the Rows and Values areas of the Pivot Table Fields pane. Change the “Values” area to “Count of [Column Name]”.
3. Click the drop-down arrow on the “Row Labels" column within the Pivot Table, and sort it from Largest to Smallest. The most frequent value appears at the top, the second most frequent on the next row.
Tips: This approach makes it easy to visualize the distribution of frequencies. You can also filter or refresh the table as your data changes. Note that blank entries will be counted as well, so you may want to filter those out for more accurate results.
Comparison: Unlike formula-based solutions, the Pivot Table method does not require complex syntax or advanced Excel skills, and is excellent for working with dynamic, growing datasets.
Demo: find the second most common/frequent number or text in Excel
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!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in