MODE not working with named range

kweaver

Well-known Member
Joined
May 12, 2009
Messages
2,934
Office Version
  1. 365
  2. 2010
I've created a named range for a block of data. AVERAGE, MEDIAN, COUNT, COUNTIF, and STDEV all work with the named range.
MODE, however, returns a #VALUE error. If I use MODE without the named range by dragging over the data (need to use CTRL as I drag because the data is not contiguous), it works.
There is only one MODE for the data.
 
You can trick Excel into doing it:

Book1
ABCDE
1
211#VALUE!
3222
4322
5432
656
767
8
Sheet1
Cell Formulas
RangeFormula
E2E2=MODE(data)
E3E3=MODE(A2:A7,C2:C7)
E4E4=MODE(INDEX(data,,,1),INDEX(data,,,2))
E5E5=MODE(SMALL(data,ROW(INDIRECT("1:"&COUNT(data)))))


If you know how many different areas are in the range, then try the E4 formula. If not, try the E5 formula.
Eric W's modified E4 formula can be used with a bounding number of areas (as a CSE formula pre 365) , e.g.,

=MODE(INDEX(data,,,ROW(1:10))) where 10 is here is used to bound the max number of areas in the range named data.
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,215,056
Messages
6,122,907
Members
449,096
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top