Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Returning the MODE of a Range.

Returning the MODE of a Range

Written by Allen Wyatt (last updated August 29, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


2

Excel provides the MODE function to help you determine the most frequently recurring value in a range. For instance, let's say you have a table that contains sales orders. One of the columns indicates the number of items ordered in each order. Over time, you may have accumulated quite a bit of data in the table. If you wanted to know the most common number of items ordered, you could use the MODE function.

Suppose your items ordered column is F, and you have 1,200 orders detailed in rows 2 through 1,201. If want to know the most common number of items ordered, you can use the following:

=MODE(F2:F1201)

The value returned represents the most commonly recurring value in the range. Thus, if 520 of your customers ordered 3 items, and the next most common was 314 customers ordering 4 items, then MODE would return the number 3.

It should be noted that the MODE function has been replaced for use in newer versions of Excel. (The MODE function is still available, but it may be completely removed in updated versions of Excel.) The new MODE functions include MODE.MULT function and MODE.SNGL function. These new functions appear to improve accuracy and give a better description of their usage. See the following Office Support articles for descriptions of these new functions:

https://support.office.com/en-us/article/mode-mult-function-50fd9464-b2ba-4191-b57a-39446689ae8c
https://support.office.com/en-us/article/mode-sngl-function-f1267c16-66c6-4386-959f-8fba5f8bb7f8

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9930) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Returning the MODE of a Range.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Deleting Rows before a Cutoff Date

If you are using Excel to work with data that is date-centered, you may want to delete some of the data before a specific ...

Discover More

Using Mail Merge to Complete Documents

Mail merge can be used to put together groups of documents that rely on common information. This tip shows how mail merge ...

Discover More

Deleting Duplicate Text Values

Got a list of data from which you want to delete duplicates? There are a couple of techniques you can use to get rid of ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Returning Item Codes Instead of Item Names

The data validation capabilities of Excel are really handy when you want to limit what is put into a cell. However, you ...

Discover More

Checking for Text

Need to figure out if a particular cell contains text? You can use the ISTEXT function to easily return this bit of trivia.

Discover More

Finding the Lowest Numbers

Need to find the lowest numbers in a range of values? It's easy to do using the SMALL worksheet function, or you can use ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 5?

2020-09-01 20:23:12

Peter Atherton

Rick
Excel 365 has a UNIQUE function, you might be able to combine this with COUNTIF. If you do not mind UDFs you can try this.


Function MaxTextVals(ref As Range) As String
Dim coll As New Collection, i As Long, maxCount As Long
Dim c As Range
On Error Resume Next
For Each c In ref
coll.Add c.value, CStr(c.value)
Next
Dim v()
ReDim v(1 To coll.Count)
maxCount = 1
For i = 1 To coll.Count
With WorksheetFunction
v(i) = .CountIf([ref], coll(i))
End With
If v(i) > maxCount Then
maxCount = v(i)
MaxTextVals = coll(i)
ElseIf v(i) = maxCount Then
MaxTextVals = MaxTextVals & ", " & coll(i)
End If
Next

End Function

SIngle Argument =MAXTEXTVALS(A1:A20)
A single value Returns John
If there are more than one max val It Returns Helen, John


2020-08-31 15:32:07

Rick

This as well as mode.mult and mode.sngl work for lists of numbers. However, is there a formula to find the "mode" of a list containing text such as names, companies, or alphanumeric part numbers?
I can do it using the advanced filter to create a list of unique records, use the countif formula, and then sort by the quantity found. But if all I am interested in is the most frequently recurring name, company, or part number, is there a formula for this?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.