If with vlookup by max number

kypok999

New Member
Joined
Oct 20, 2017
Messages
41
Dear all,

A bit stuck here

I am trying to find a formula based on max number

Column A I have lets say A2=Chemical WasteLU2 7BZ, B2 = Luton C2=1

NExt line is same but different in column b and c as per below:

A2=Chemical WasteLU2 7BZ, B3 = Warrington C3=2

So I need to always show result based on highest number in Column C in aboive case it would be Warrington based on unique identifier in column A3 and C3 is more then C2

Thank you
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try


Book1
ABC
1Chemical WasteLU2 7BZLuton1
2Chemical WasteLU2 7BZWarrington2
3
4Warrington
Sheet1
Cell Formulas
RangeFormula
A4=INDEX(B1:B2,MATCH(MAX(C1:C2),C1:C2,0))


Note if there is a tie in the largest number then index will return the first match it finds.
Also Vlookup looks to the right. If you want to look to the left with vlookup you would have to create the correctly ordered columns with choose.
 
Upvote 0
Thank you Scott I forgot to mention it should look for unique identifier which can be different in column a

Try

ABC
1Chemical WasteLU2 7BZLuton1
2Chemical WasteLU2 7BZWarrington2
3
4Warrington

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
A4=INDEX(B1:B2,MATCH(MAX(C1:C2),C1:C2,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Note if there is a tie in the largest number then index will return the first match it finds.
Also Vlookup looks to the right. If you want to look to the left with vlookup you would have to create the correctly ordered columns with choose.
 
Upvote 0
Control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6="a",IF($C$2:$C$6=MAX(IF($A$2:$A$6="a",$C$2:$C$6)),ROW($B$2:$B$6)-ROW($B$2)+1)),ROWS($1:1))),"")

Replace "a" with a relevant id which the range in column A must meet.
 
Upvote 0

Forum statistics

Threads
1,215,473
Messages
6,125,013
Members
449,204
Latest member
tungnmqn90

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