Problem with using index, match and large functions together

thakkarvamar

New Member
Joined
Sep 14, 2011
Messages
19
My data is in 2 columns like this

Net sales total income
co1
co2
..
..

I want to find out the top 3 companies as per net sales. I want the sum of total incomes of these 3 companies.

I have written this formula to achieve my objective

IFERROR(INDEX(Total_income,MATCH(LARGE(Net_sales,1),Net_sales,0)),0)+IFERROR(INDEX(Total_income,MATC H(LARGE(Net_sales,2),Net_sales,0)),0)+IFERROR(INDEX(Total_income,MATCH(LARGE(Net_sales,3),Net_sales, 0)),0)

It works fine when net sales numbers for all companies are unique. But if any 2 companies have equal net sales.. it picks total income of same company twice.
Also I can add a column where I rank the companies as per net sales and use this column to solve my problem. But, I don't want to add any column to my data.

<table border="0" cellpadding="0" cellspacing="0" width="215"><col style="width:48pt" span="2" width="64"> <col style="mso-width-source:userset;mso-width-alt:3181;width:65pt" width="87"> <tbody><tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;width:48pt" height="20" width="64"> </td> <td class="xl63" style="border-left:none;width:48pt" width="64">Net sales</td> <td class="xl63" style="border-left:none;width:65pt" width="87">Total income</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;border-top:none" height="20">co1</td> <td class="xl63" style="border-top:none;border-left:none" align="right">100</td> <td class="xl63" style="border-top:none;border-left:none" align="right">100</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;border-top:none" height="20">co2</td> <td class="xl63" style="border-top:none;border-left:none" align="right">200</td> <td class="xl63" style="border-top:none;border-left:none" align="right">1000</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;border-top:none" height="20">co3</td> <td class="xl63" style="border-top:none;border-left:none" align="right">150</td> <td class="xl63" style="border-top:none;border-left:none" align="right">150</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;border-top:none" height="20">co4</td> <td class="xl63" style="border-top:none;border-left:none" align="right">200</td> <td class="xl63" style="border-top:none;border-left:none" align="right">200</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl63" style="height:15.0pt;border-top:none" height="20">co5</td> <td class="xl63" style="border-top:none;border-left:none" align="right">300</td> <td class="xl63" style="border-top:none;border-left:none" align="right">300</td> </tr> </tbody></table>
The output of my formula comes to 300 + 1000 +1000 = 2300
It should actually come to 300 + 1000 + 200 = 1500
thanks in advance
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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