POSITION of nth smallest value in multiple criteria

Sudheer121

New Member
Joined
Oct 28, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am getting nth smallest value with multiple criteria but couldnt get the position of it.

I need postition to lookup other values in the same row of the nth smallest

I used the following formulas

=IF(AK$2=0,"",IFERROR(SMALL(IF($K$4:$K$20=AK$2,$I$4:$I$20),$U$4:$U$20),""))

No issue with this formula, but following is not working

=+INDEX($J$4:$J$20,SMALL(IF(AND($I$4:$I$20=AK4,$K$4:$K$20=$AK$2),ROW($I$4:$I$20)-ROW($I$4)+1),COUNTIF($AK$4:AK4,AK4)))

Pls suggest
 

Attachments

  • 456.JPG
    456.JPG
    123 KB · Views: 57

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.
Hi & welcome to MrExcel.
How about
Excel Formula:
=SORT(FILTER(FILTER(I4:L20,K4:K20=AK2),COLUMN(I4:L4)<>11))
 
Upvote 0
Does it return an error of some sort?
If so what?
 
Upvote 0
Try the following idea if it suits you.

In the 'AK:AM' columns, the result you want is returned but the data is not sorted.
In the 'AP:AR' columns the data are sorted and based on the data from the columns 'AK:AL'

The formulas are as follows:
In the 'AK4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(I$4:I$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AL4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(J$4:J$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AM4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(L$4:L$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AP4' cell
Code:
=IFERROR(SMALL($AK$4:$AK$17;ROWS($AK$3:AK3));"")
In the 'AQ4' cell
Code:
=IFERROR(INDEX(AL$4:AL$17;AGGREGATE(15;6;(ROW(AL$4:AL$17)-ROW(AL$4)+1)/($AK$4:$AK$17=$AP4);COUNTIF($AP$4:$AP4;$AP4)));"")
In the 'AR4' cell
Code:
=IFERROR(INDEX(AM$4:AM$17;AGGREGATE(15;6;(ROW(AM$4:AM$17)-ROW(AM$4)+1)/($AK$4:$AK$17=$AP4);COUNTIF($AP$4:$AP4;$AP4)));"")
 

Attachments

  • Sudheer121.png
    Sudheer121.png
    10.1 KB · Views: 24
Upvote 0
Solution
Try the following idea if it suits you.

In the 'AK:AM' columns, the result you want is returned but the data is not sorted.
In the 'AP:AR' columns the data are sorted and based on the data from the columns 'AK:AL'

The formulas are as follows:
In the 'AK4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(I$4:I$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AL4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(J$4:J$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AM4' cell ARRAY formula finished with CSE.
Code:
=IFERROR(INDEX(L$4:L$17;SMALL(IF(($AK$2=$K$4:$K$17);ROW($I$4:$I$17));ROW(1:1))-3;1);"")
In the 'AP4' cell
Code:
=IFERROR(SMALL($AK$4:$AK$17;ROWS($AK$3:AK3));"")
In the 'AQ4' cell
Code:
=IFERROR(INDEX(AL$4:AL$17;AGGREGATE(15;6;(ROW(AL$4:AL$17)-ROW(AL$4)+1)/($AK$4:$AK$17=$AP4);COUNTIF($AP$4:$AP4;$AP4)));"")
In the 'AR4' cell
Code:
=IFERROR(INDEX(AM$4:AM$17;AGGREGATE(15;6;(ROW(AM$4:AM$17)-ROW(AM$4)+1)/($AK$4:$AK$17=$AP4);COUNTIF($AP$4:$AP4;$AP4)));"")
Hi navic,

Thanks for the effort you put on for me.

I used the attached formula and its working fine. Thank you.

1604038670875.png
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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