# Formula to Extract Unqiue Numbers

#### legalhustler

##### Well-known Member
I have the following array formula that requires CSE, but would like to change it so I don't use CSE. I think AGGREGATE function would be a substitute?? Can someone help.

{=IF(ROWS(\$C\$4:C4)<=\$D\$4,INDEX(\$C\$4:\$C\$51,SMALL(IF(FREQUENCY(IF(\$C\$4:\$C\$51<>"",MATCH(\$C\$4:\$C\$51,\$C\$4:\$C\$51,0)),ROW(\$C\$4:\$C\$51)-ROW(\$C\$4)+1),ROW(\$C\$4:\$C\$51)-ROW(\$C\$4)+1),ROWS(\$C\$4:C4))),"")}

Last edited:

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

##### MrExcel MVP
It looks like the need of applying control+shift+enter (CSE) bothers you. The following set up does not require CSE.

 Row\Col C​ D​ E​ 3​ Num 0​ unique 4​ 2​ 1​ 2​ 5​ 2​ 5​ 6​ 5​ 2​ 7​ 7​ 5​ 3​ 8​ 7​ 3​ 6​ 9​ 7​ 8​ 10​ 3​ 4​ 11​ 6​ 5​ 12​ 2​ 13​ 7​ 14​ 8​ 6​

D3 must house a 0.

In D4 enter and copy down:

=IF(ISNUMBER(MATCH(\$C4,\$C\$3:C3,0)),"",LOOKUP(9.99999999999999E+307,\$D\$3:D3)+1)

In E4 enter and copy down:

=IF(ROWS(\$E\$4:E4)<=LOOKUP(9.99999999999999E+307,\$D\$4:\$D\$14),LOOKUP(ROWS(\$E\$4:E4),\$D\$4:\$D\$14,\$C\$4:\$C\$14),"")

#### legalhustler

##### Well-known Member
It looks like the need of applying control+shift+enter (CSE) bothers you. The following set up does not require CSE.

 Row\Col C​ D​ E​ 3​ Num 0​ unique 4​ 2​ 1​ 2​ 5​ 2​ 5​ 6​ 5​ 2​ 7​ 7​ 5​ 3​ 8​ 7​ 3​ 6​ 9​ 7​ 8​ 10​ 3​ 4​ 11​ 6​ 5​ 12​ 2​ 13​ 7​ 14​ 8​ 6​

D3 must house a 0.

In D4 enter and copy down:

=IF(ISNUMBER(MATCH(\$C4,\$C\$3:C3,0)),"",LOOKUP(9.99999999999999E+307,\$D\$3:D3)+1)

In E4 enter and copy down:

=IF(ROWS(\$E\$4:E4)<=LOOKUP(9.99999999999999E+307,\$D\$4:\$D\$14),LOOKUP(ROWS(\$E\$4:E4),\$D\$4:\$D\$14,\$C\$4:\$C\$14),"")

Anyways to avoid helper columns too? Also formula needs to exclude empty cells, like shown in my original formula.

Last edited:

##### MrExcel MVP
Anyways to avoid helper columns too?

That's the gist of the set up. It trades off cell memory against more speed (and no CSE).

Also formula needs to exclude empty cells, like shown in my original formula.

Modify the formula in D4 to...

=IF(\$C4="","",IF(ISNUMBER(MATCH(\$C4,\$C\$3:C3,0)),"",LOOKUP(9.99999999999999E+307,\$D\$3:D3)+1))

and copy down.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,423
Messages
5,837,152
Members
430,479
Latest member
mamush200

### 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?

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