Small, Vlookup, Not sure

dcamos

Board Regular
Joined
May 21, 2008
Messages
225
I am trying to create a formula to show the top,followed by 2nd, 3rd, ... and bottom, followed by 2nd, 3rd ... in a list.

Column A has unique values, Column C is what I want to return, Columns E and H have criteria and column S is what I want to find the largest and smallest of. I am not really sure how to go about it. Column S can have duplicates.

Thanks,
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
To retrieve the smallest value, use:
=INDEX($C$1:$C$10,MATCH(SMALL($S$1:$S$10,1),$S$1:$S$10,0))
change the "1" in the SMALL function to a 2 to find the 2nd smallest
 
Upvote 0
Perhaps try this:

In Y2 use this formula for the largest value in column S which matches the criteria in columns E and H

=LARGE(IF(E$2:E$100=X$1,IF(H$2:H$100=X$2,S$2:S$100)),ROWS(Y$2:Y2))

confirm with CTRL+SHIFT+ENTER and copy down as far as required to get a list of the column S values (in order) where the criteria match [assumes X1 and X2 contain the criteria]

Now in Z2 copied down for the matching column C values:

=INDEX(C$2:C$100,SMALL(IF(E$2:E$100=X$1,IF(H$2:H$100=X$2,IF(S$2:S$100=Y2,ROW(C$2:C$100)-ROW(C$2)+1))),COUNTIF(Y$2:Y2,Y2)))

also confirmed with CTRL+SHIFT+ENTER and copied down

adjust ranges as required, you can do the same with SMALL....
 
Upvote 0
My formula will deal with duplicates. I'm assuming also that criteria need to be met in two other columns....

column Y will give a list of the numbers (from largest to smallest) where criteria are met. If that contains duplicates then the column Z formula will deal with that to pull out each column C value......
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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