MODE Function

D

david park

Hello,

I'm trying to build a single statement that finds the most
common answer (MODE) but it has to conditional.
Essentially, I'm looking for a function similar to countif
or sumif, but that pertains to MODE. Is there one? or a
workaround?

DP
 
J

Jason Morin

One possibility is to apply an autofilter first to your
data (Data > Filter > AutoFilter). Let's assume it columns
A and B, and the "condition" is in column A. Select that
condition or criterion in the drop-down list for A. Now
use this formula (array-entered, meaning press
ctrl/shift/enter):

=MODE(IF(SUBTOTAL(9,OFFSET(B2:B9,ROW(B2:B100)-MIN(ROW
(B2:B100)),,1))>0,B2:B100))

to get the mode of the range of values in col. B, based on
the condition selected in col. A.

HTH
Jason
Atlanta, GA
 
H

Harlan Grove

Jason Morin said:
One possibility is to apply an autofilter first to your
data (Data > Filter > AutoFilter). Let's assume it columns
A and B, and the "condition" is in column A. Select that
condition or criterion in the drop-down list for A. Now
use this formula (array-entered, meaning press
ctrl/shift/enter):

=MODE(IF(SUBTOTAL(9,OFFSET(B2:B9,ROW(B2:B100)-MIN(ROW
(B2:B100)),,1))>0,B2:B100))

to get the mode of the range of values in col. B, based on
the condition selected in col. A.
....

And the benefits of this rather than the array formula

=MODE(IF(A$2:A$100>x,B$2:B$100))

where the criteria would vary with x are what?
 
J

Jason Morin

Very good point. I'm still at work after 16 hours, which
means my brain is obviously off.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top