Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.

Conditional mode with criteria

We can use an array formula that is based on IF and MODE function to calculate a conditional mode with one or more criteria. This post looks at how we can use these two functions to calculate conditional mode with criteria.

Figure 1: How to calculate conditional mode with criteria

General syntax of the formula

{=MODE(IF(criteria, data))}

How the formula works

  • It is important to note that the MODE function has got no built-in way to apply any criteria.
  • This means that the function will return the most occurring number in any range supplied to it.
  • We need to use the IF function to apply a given criteria, which tests the data value in the group to see if it matches the supplied criteria.
  • The logical test is based on an array containing multiple values, thus the result should also be an array of TRUE FALSE.
  • Here, each TRUE will represent a row with “B” as the group, as in our above example. The IF function will then return the corresponding value for each TRUE in the array. FALSE values will not be changed.
  • In our example above, we shall have an array of results that looks more like the one below;

{4;FALSE;5;FALSE;4;FALSE;2;FALSE;3;FALSE}

  • The array will then be taken to the MODE function so that we can get the most frequently occurring value in the group. In our example, this value is C which appears 5 times.
  • It is important to note that the formula is an array formula, thus needs to be entered in an array format.

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Solution examples
Could you help me by explaining the IF function?
Solved by G. L. in 24 mins
I have a question about Conditional Formatting. =IF('Sheet1'!A1="X",IF('Sheet1'!B1="Y", TRUE, FALSE),FALSE) the set the cell background to red. I would like to make it so that if Sheet1'!B1="Z" I set the back to blue. How can I achieve this.
Solved by B. F. in 39 mins
I need to find out if the 2018 yearly sales goals were met if the yearly sales were $25,000 or more using an IF logical function and to set the formula to return a value of YES if met, and NO if not
Solved by A. A. in 18 mins
I filtered data in column A (it is labeled ID #) of a data set. On my next worksheet, column A is also the ID #, but it is a different data set. I want to filter the ID #'s the same for the two sheets, but how do I do that being that I am working with two different sets of data?
Solved by V. H. in 22 mins
i want to create a very simple if function in a cell which is, if one cell is less than 1250, then the automatic value in the current cell is 250, dead easy, for someone who knows! Thank you.
Solved by A. H. in 14 mins

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc