Row Lookup

RBone90

New Member
Joined
Apr 20, 2018
Messages
7
So I have a large list of data that contains multiple categories. I am wanting it to automatically pull from highest to lowest based off criteria in another cell. If I wanted to see the highest for KY for Division 10 then the second highest. I would also want to pull more than just the amounts so I figure knowing the row number is the best way.

AmountDivisionState
$ 100.0010KY
$ 150.0010KY
$ 175.0015KY
$ 130.0020TN
$ 180.0022TN

<colgroup><col><col span="2"></colgroup><tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This should help. More condition can be added by expanding upon the logic in the array argument of function AGGREGATE.

Copy the formula across and down as necessary.


Book1
ABCDEFGHI
3Amount rank
4AmountDivisionStateDivisionState123
5$100.0010KYKY10150100na
6$150.0010KYTN22180nana
7$175.0015KYAB16nanana
8$130.0020TNKY15175nana
9$180.0022TN
Sheet63
Cell Formulas
RangeFormula
G5=IF(COUNTIFS($C$5:$C$9,$E5,$B$5:$B$9,$F5)>=G$4,AGGREGATE(14,6,($E5=$C$5:$C$9)*($F5=$B$5:$B$9)*($A$5:$A$9),G$4),"na")
 
Upvote 0
Excel 2016 (Windows) 32 bit
A
B
C
D
E
F
G
1
AmountDivisionStateDivisionState
2
$100.00​
10​
KY
10​
KY
3
$150.00​
10​
KYRowAmount
4
$175.00​
15​
KY
3​
150​
5
$130.00​
20​
TN
2​
100​
6
$180.00​
22​
TN
7
Sheet: Sheet10

Array formula in cell E4:
=MATCH(F4&"-"&$E$2&"-"&$F$2,$A$1:$A$6&"-"&$B$1:$B$6&"-"&$C$1:$C$6,0)

Array formula in cell F4:
=LARGE(IF(($B$2:$B$6=$E$2)*($C$2:$C$6=$F$2),$A$2:$A$6,""),ROWS($A$1:A1))
 
Upvote 0

Forum statistics

Threads
1,215,883
Messages
6,127,553
Members
449,385
Latest member
KMGLarson

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