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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
The table should look like:
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Morgan Stanley[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Scotia Capital[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]Haywood Securities[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
The table should look like:
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Firm[/TD]
[TD="align: center"]Volume[/TD]
[/TR]
[TR]
[TD]National Bank[/TD]
[TD]12,000[/TD]
[/TR]
[TR]
[TD]CIBC World Markets[/TD]
[TD]10,000[/TD]
[/TR]
[TR]
[TD]TD Securities[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Morgan Stanley[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Scotia Capital[/TD]
[TD]5,000[/TD]
[/TR]
[TR]
[TD]Interactive Brokers[/TD]
[TD]2,000[/TD]
[/TR]
[TR]
[TD]PI Financial[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]Haywood Securities[/TD]
[TD]1,000[/TD]
[/TR]
[TR]
[TD]RBC Financial[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]