Finding most common number in a range

nirvehex

Well-known Member
Joined
Jul 27, 2011
Messages
505
Office Version
  1. 365
Platform
  1. Windows
Hi all - I'm looking to create a formula that will return the most common number in a range. I can't just use the mode function as my list contains decimal numbers and I want to return the most single digit number in the range. In the example table below, the most common number would be 6 as it appears 4 times throughout. Any ideas on a formula that would work for this? Thank you!!

3.67​
3.26​
6.16​
 
Sorry - another question. I'm getting a #SPILL! error when I use this data set below, using this formula: =LET(c,SUBSTITUTE(CONCAT(ABS(B5:B21)),".",""),MODE.MULT(--MID(c,SEQUENCE(LEN(c)),1)))
Does this mean there are two numbers that have the same amount and are the most common?

2.91​
2.55​
3.28​
2.33​
2.67​
2.5​
0​
-0.22​
11.00​
29.41​
-1​
0.45​
-1​
-3.28​
-1.07​
101.01​
90.74​
Did you try the formula I posted yet?
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Do you have a value right underneath where the formula is? It should've returned 2 values one right under the other
 
Upvote 0
Does this mean there are two numbers that have the same amount and are the most common?
Yes. That sample data contains ten "1"s and ten "2"s.

You will only get the spill error if you have something already in the cell immediately below the cell that contains this formula & the data contains more than one "equal most" digit.

If you want to report all values if they are equally most common then there are options.

First, you could ensure there is plenty of room under the formula cell to accommodate any equal most common value like in D5 below.
Second, if you have space to the right of the formula cell you could use a formula like in D17.
Third, you could report all the values in a single cell like D19.
D21 offers a fourth option where any equally popular digits are put into ascending order.

24 02 25.xlsm
BCDE
52.912
62.551
73.28
82.33
92.67
102.5
110
12-0.22
1311
1429.41
15-1
160.45
17-121
18-3.28
19-1.072, 1
20101.01
2190.741, 2
Mode (4)
Cell Formulas
RangeFormula
D5:D6D5=LET(c,SUBSTITUTE(CONCAT(ABS(B5:B21)),".",""),MODE.MULT(--MID(c,SEQUENCE(LEN(c)),1)))
D17:E17D17=LET(c,SUBSTITUTE(CONCAT(ABS(B5:B21)),".",""),TRANSPOSE(MODE.MULT(--MID(c,SEQUENCE(LEN(c)),1))))
D19D19=LET(c,SUBSTITUTE(CONCAT(ABS(B5:B21)),".",""),TEXTJOIN(", ",,MODE.MULT(--MID(c,SEQUENCE(LEN(c)),1))))
D21D21=LET(c,SUBSTITUTE(CONCAT(ABS(B5:B21)),".",""),TEXTJOIN(", ",,SORT(MODE.MULT(--MID(c,SEQUENCE(LEN(c)),1)))))
Dynamic array formulas.
 
Upvote 0
Thanks, I did have a value right below. I fixed it. Appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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