Extract a sorted and ranked unique list of items (help fix my formula)

bruno_

New Member
Joined
Feb 11, 2013
Messages
1
Hello,


My name is Bruno and it's my first time here.


I need a formula that will extract a sorted, unique list of strings, ranked by number of ocorrences (most ocurring items first). Example:


Original list (single column, unknown number os rows, with some blank cells):
CC
AA
(blank cell)
BB
(blank cell)
AA
CC
AA
(blank cell)
(blank cell)
(blank cell)


Resulting list would be (unique results, most frequent items first, no blank rows):
AA
CC
BB


The resulting list should update automatically when there are modifications in the original list, so using data pilot or filters is no good.


The following array formula is what I've got so far. It's entered on B2 and copied down:


=INDEX(lista;MODE(IF(ISNA(MATCH(list;B$1:B1;0));MATCH(list;list;0)*{1.1})))


It's a simplified (stripped down) version of Haseeb's formula, from the following post:
Ranking string data for one column « Chandoo.org - Learn Excel & Charting Online - Forums
Also mentioned in the following article:
Extract a Sorted & Ranked Unique list of items with criteria | Chandoo.org - Learn Microsoft Excel Online


Here is the problem: The formula works perfectly IF there are no blank cells in the original list (interval). A single blank cell turns all of the result cells into "#N/A". I've been trying to get it to work with blank cells (ignoring them) for several days, with no success. I use a lot of spreadsheets at work, but never used an array formula before.


Thanks in advance,
Bruno
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

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