Output the nth smallest UNIQUE number with one condition

jojolvu

New Member
Joined
Mar 10, 2015
Messages
3
Hello,

I have a table such as this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Apples[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD]16[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]26[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]26[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]27[/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]28[/TD]
[/TR]
</tbody>[/TABLE]

How do I output the nth smallest unique value if column A is "Apples"?

The array formula I have to output the 3rd smallest NONunique value is as follows:

=SMALL(IF(A:A="Apples",B:B,""),3)

This returns a value of 26 because it is not considering a unique value. How do I get it to return 27?


Thank you for your help!!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
To return the 3rd smallest unique value of column B without a condition, the array formula is:

=SMALL(IF(B:B>SMALL(B:B,3),B:B),1)

How do I combine the two formulas so that there is a condition to out put the 3rd smallest UNIQUE number?
 
Upvote 0
Take a helper col-C
C1==SUMPRODUCT(--($A$1:$A$8=A1)*($B$1:$B$8=B1)) copy down

=SMALL(IF((A:A="Apples')*(C:C=1),B:B,""),1) Array formula

Hope this helps u
Regards
Sridhar
 
Upvote 0
Take a helper col-C
C1==SUMPRODUCT(--($A$1:$A$8=A1)*($B$1:$B$8=B1)) copy down

=SMALL(IF((A:A="Apples')*(C:C=1),B:B,""),1) Array formula

Hope this helps u
Regards
Sridhar

Try here.

Excel 2013
AB
1Apples25
2Oranges16
3Apples25
4Apples25
5Apples26
6Apples27
7Oranges18
8Apples29
Sheet_1
 
Upvote 0
Hi.

You certainly shouldn't use entire column references within an array formula, which will be forced to calculate over all one million-plus cells, whether technically beyond the last-used cell in that range or not.

Try this array formula**:

=SMALL(IF(FREQUENCY(IF(A1:A8="Apples",B1:B8),B1:B8),B1:B8),3)

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0

Forum statistics

Threads
1,223,060
Messages
6,169,861
Members
452,286
Latest member
noclue2000

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