Return top 5 highest values + corresponding data

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
274
Office Version
  1. 365
Platform
  1. Windows
hello experts I am really struggling to write a formula for the cells in orange. I'm trying to populate the cells in orange so the formula looks at my "data table" sheet and returns the top 5 results (in terms of value) plus the corresponding client and service. The results need to tie up with fixed data for bid status and entity as there are lots of different bid statuses and entities.

Right now I'm just manually typing in the data each week... hopefully someone can offer a solution!

Bid database.xlsx
BCDE
4TABLE 1
5Bid status:Under preparation
6Entity:Company A
7
8ClientServicesValue
9Pauldetail of services5,000
10Mohdetail of services900
11Geoffdetail of services600
12Neildetail of services500
13Valentinadetail of services400
14
15TABLE 2
16Bid status:Submitted
17Entity:Company B
18
19ClientServicesValue
20
21
22
23
24
Summary


Bid database.xlsx
CDHIK
3Bid statusEntityClientServicesValue
4Under preparationCompany CPauldetail of services5,000
5Under preparationCompany CMohdetail of services900
6Under preparationCompany AGeoffdetail of services600
7Under preparationCompany ANeildetail of services500
8Under preparationCompany BValentinadetail of services400
9Under preparationCompany CFatimadetail of services200
10Under preparationCompany BDaviddetail of services150
11SubmittedCompany APauldetail of services950
12SubmittedCompany AAvadetail of services620
13SubmittedCompany BAlandetail of services1,500
14SubmittedCompany BNeildetail of services90,000
15SubmittedCompany CGeoffdetail of services600
16SubmittedCompany CValentinadetail of services350
17SubmittedCompany CDaviddetail of services380
18SubmittedCompany CFatimadetail of services490
19LostCompany APauldetail of services560
20LostCompany AMohdetail of services810
21LostCompany BPauldetail of services930
22LostCompany BAvadetail of services810
23LostCompany CAlandetail of services650
24WonCompany CNeildetail of services950
25WonCompany CGeoffdetail of services450
26WonCompany AValentinadetail of services6,000
27WonCompany ADaviddetail of services890
28WonCompany BFatimadetail of services500
Data table
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Should the entity / company name be used as criteria? The layout implies that it should but the the example results do not, is this what you're looking for?

Book1
BCDE
4TABLE 1
5Bid status:Under preparation
6Entity:Company A
7
8ClientServicesValue
9Geoffdetail of services600
10Neildetail of services500
11   
12   
13   
14
15TABLE 2
16Bid status:Submitted
17Entity:Company B
18
19ClientServicesValue
20Neildetail of services90000
21Alandetail of services1500
22   
23   
24   
Summary
Cell Formulas
RangeFormula
C9:D13C9=IF($E9="","",INDEX('Data Table'!H:H,AGGREGATE(15,6,ROW('Data Table'!H$4:H$28)/('Data Table'!$K$4:$K$28=$E9)/('Data Table'!$C$4:$C$28=$C$5)/('Data Table'!$D$4:$D$28=$C$6),COUNTIF($E$9:$E9,$E9))))
E9:E13E9=IFERROR(AGGREGATE(14,6,'Data Table'!$K$4:$K$28/('Data Table'!$C$4:$C$28=$C$5)/('Data Table'!$D$4:$D$28=$C$6),ROWS(E$9:E9)),"")
C20:D24C20=IF($E20="","",INDEX('Data Table'!H:H,AGGREGATE(15,6,ROW('Data Table'!H$4:H$28)/('Data Table'!$K$4:$K$28=$E20)/('Data Table'!$C$4:$C$28=$C$16)/('Data Table'!$D$4:$D$28=$C$17),COUNTIF($E$20:$E20,$E20))))
E20:E24E20=IFERROR(AGGREGATE(14,6,'Data Table'!$K$4:$K$28/('Data Table'!$C$4:$C$28=$C$16)/('Data Table'!$D$4:$D$28=$C$17),ROWS(E$20:E20)),"")
 
Upvote 0
Should the entity / company name be used as criteria? The layout implies that it should but the the example results do not, is this what you're looking for?
yes you are right, I did not copy-paste it across right! entity matters
 
Upvote 0
works great, thanks so much, I spent a lot of time trying to do this and really I was nowhere near
 
Upvote 0
I spent a lot of time trying to do this and really I was nowhere near
That might not be strictly true, there are a couple of other ways to do the same thing (with and without helper columns), I just find this to be the most flexible and most reliable method, others may have a different preference.

It might be a good idea to format the database as a table or use dynamic named ranges to that the formulas adjust to the data correctly. After setting up the table you will need to correct the formulas to match the table names, once you have done that any newly added rows will be included automatically.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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