Formula to use to find top 3 and the adjacent cell label?

Caveman1964

Board Regular
Joined
Dec 14, 2017
Messages
127
Office Version
  1. 2016
Platform
  1. Windows
Hi,
Need help with a formula that will find the top 3 in a table and place the item in cell before.
In bottom table, D will have formula that will pick up 420, and C2 will pick up SQuash, then D3 will pick up 325 and C2 will pick up Okra. and so on.
I found how to use =large to pick up in order of top sold but cant find how to get the adjacent cell also. So C2 and D2 needs its own formula......spent a few days on this and just can't get it.
any help will be much appreciated.
Thanks!

AB
1Item Sold lbs
2 Lettuce88
3Tomatoes248
4Onions85
5Okra325
6Squash420
7Bell Pepper45
8Green Beans180
9Field peas135

<tbody>
</tbody>

CD
1ItemTop 3
2
3
4

<tbody>
</tbody>
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try this : (Sorry had it backwards, now it's fine)

Sheet1


ABCD
ItemSold lbs
Lettuce
Tomatoes
Onions

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:150.4px;"><col style="width:85.6px;"><col style="width:85.6px;"><col style="width:85.6px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

[TD="align: center"]Item[/TD]
[TD="align: center"]Top 3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]

[TD="align: right"]88[/TD]
[TD="align: center"]Squash[/TD]
[TD="align: right"]420[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]

[TD="align: right"]248[/TD]
[TD="align: center"]Okra[/TD]
[TD="align: right"]325[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]

[TD="align: right"]85[/TD]
[TD="align: center"]Tomatoes[/TD]
[TD="align: right"]248[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2=IFERROR(INDEX(A:A, AGGREGATE(15, 7, ROW(A:A)/(B$1:B$8=D2), COUNTIF(D$2:D2, D2))),"")
D2=IFERROR(LARGE(B$2:B$8, ROW(1:1)),"")
C3=IFERROR(INDEX(A:A, AGGREGATE(15, 7, ROW(A:A)/(B$1:B$8=D3), COUNTIF(D$2:D3, D3))),"")
D3=IFERROR(LARGE(B$2:B$8, ROW(2:2)),"")
C4=IFERROR(INDEX(A:A, AGGREGATE(15, 7, ROW(A:A)/(B$1:B$8=D4), COUNTIF(D$2:D4, D4))),"")
D4=IFERROR(LARGE(B$2:B$8, ROW(3:3)),"")

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4



Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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