Vlookup unable to return the next cell that meets criteria

A_Filippo

New Member
Joined
Jul 12, 2019
Messages
2
I'm trying to build a table that lists a broker's volume from largest to smallest (top 10 firms only). If there are only 9 values in the data set, a zero will appear in the row.

To grab the volume, from largest to smallest, I'm using =LARGE($B$2:$B$63,1), =LARGE($B$2:$B$63,2), =LARGE($B$2:$B$63,3), ... =LARGE($B$2:$B$63,10). Then I'm doing a Vlookup to grab the corresponding firm. The issue arises when there is a duplicate volume number, it will grab the first firm in the data set multiple times instead of listing the second or third firm. How do I get excel to look for the next corresponding firm and IF there is a 0 in the volume row, to return a blank.


FirmVolume
National Bank12,000
CIBC World Markets10,000
TD Securities5,000
TD Securities5,000
TD Securities5,000
Interactive Brokers2,000
PI Financial1,000
PI Financial1,000
RBC Financial500
0

<tbody>
</tbody>


The table should look like:

****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
FirmVolume
National Bank12,000
CIBC World Markets10,000
TD Securities5,000
TD Securities5,000
TD Securities5,000
Interactive Brokers2,000
PI Financial1,000
PI Financial1,000
RBC Financial500

<tbody>
</tbody>

FirmVolume
National Bank12,000
CIBC World Markets10,000
TD Securities5,000
Morgan Stanley5,000
Scotia Capital5,000
Interactive Brokers2,000
PI Financial1,000
Haywood Securities1,000
RBC Financial500
0

<tbody>
</tbody>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the forum.

How about:


Book1
ABCDEF
1FirmVolumeFirmVolume
2CIBC World Markets10000National Bank12,000
3Scotia Capital5000CIBC World Markets10,000
4PI Financial1000Scotia Capital5,000
5TD Securities5000TD Securities5,000
6Interactive Brokers2000Morgan Stanley5,000
7Haywood Securities1000Interactive Brokers2,000
8National Bank12000PI Financial1,000
9Morgan Stanley5000Haywood Securities1,000
10RBC Financial500RBC Financial500
11
Sheet4
Cell Formulas
RangeFormula
E2=IF(F2<>"",INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$63)/($B$2:$B$63=F2),COUNTIF($F$2:$F2,F2))),"")
F2=IFERROR(LARGE($B$2:$B$63,ROWS($F$2:$F2)),"")
 
Upvote 0
That worked, amazing Eric. Spent many hours on Youtube and on here trying to piece this together. Enjoy your weekend and thanks again.
 
Upvote 0
Glad it worked for you. Thanks for the feedback. :cool:

Have a good weekend yourself.
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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