Large Function with Ranking

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
608
Office Version
  1. 365
Platform
  1. Windows
Hello,
There are times where I have to add 2-4 more orders from the Master column to the Individual worksheet.
Example, B12 might have prices that auto populate from another program.

I would need to add the 4 highest prices from the Master columns with order numbers below it without duplicating any of them.

If B12 & B13 had prices, I would need to add 3 more orders. I need to keep the prices that populate in column B and add to it.
I thought I could use the Large function which works perfectly if the prices that auto populate are the highest prices in the list.

For example, if I change the price of B12 to 35.02, the next entry becomes 3487.76. It should be 5894.21.

Is there a way to show the next highest prices without duplicating what is already listed?
Any help is appreciated

Book1
ABCDEFG
1IndividualMaster
2OrderPriceCodeOrderPriceCode
3w1111752BK1026w814.12Crt
4w1112367.94BK1026w620.32Crt
5w1113358.56BK1026w2847.47Crt
6w123497.89BK1026w2641.66Crt
7w87691112.89BK1026w2435.02Crt
8w54213574.76BK1026w2229.28Crt
912025981.21BK1026w2023.08Crt
101203107.32BK1026w1816.88Crt
111204101.12BK1026w1610.68Crt
121025w65894.21Crt1026w149.58Crt
1399993487.761026w121.72Crt
1499881025.891026w107.92Crt
1599846651025w65894.21Crt
169985280.9499993487.76Crt
1799881025.89Crt
18998710.89Crt
199986271.56Crt
209985280.94Crt
219984665Crt
Sheet1
Cell Formulas
RangeFormula
A12A12=INDEX($E$3:$E$21,AGGREGATE(15,6,(ROW($F$3:$F$21)-ROW($F$3)+1)/($F$3:$F$21=$B12),COUNTIF($B12:B$12,$B12)))
A13:A16A13=INDEX($E$3:$E$21,AGGREGATE(15,6,(ROW($F$3:$F$21)-ROW($F$3)+1)/($F$3:$F$21=$B13),COUNTIF($B$12:B13,$B13)))
B13:B16B13=LARGE($F$3:$F$21,ROWS(B$12:B13))
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try this in B13

=AGGREGATE(14,6,$F$3:$F$21/ISNA(MATCH($E$3:$E$21,$A$3:$A12,0)),ROWS(B$13:B13))
 
Upvote 0
Thank you for responding. The Aggregate function has so many uses! I think its closer to what I need but... if I change the price in B12 to 14.12, the next entries should be 5894.21, 3487.76, 1025.89 & 280.94.


Book1
ABCDEFG
1IndividualMaster
2OrderPriceCodeOrderPriceCode
3w1111752BK1026w814.12Crt
4w1112367.94BK1026w620.32Crt
5w1113358.56BK1026w2847.47Crt
6w123497.89BK1026w2641.66Crt
7w87691112.89BK1026w2435.02Crt
8w54213574.76BK1026w2229.28Crt
912025981.21BK1026w2023.08Crt
101203107.32BK1026w1816.88Crt
111204101.12BK1026w1610.68Crt
121026w814.12Crt1026w149.58Crt
131025w65894.211026w121.72Crt
1499881025.891026w107.92Crt
159985280.941025w65894.21Crt
161026w2847.4799993487.76Crt
1799881025.89Crt
18998710.89Crt
199986271.56Crt
209985280.94Crt
219984665Crt
Sheet1
Cell Formulas
RangeFormula
A12A12=INDEX($E$3:$E$21,AGGREGATE(15,6,(ROW($F$3:$F$21)-ROW($F$3)+1)/($F$3:$F$21=$B12),COUNTIF($B12:B$12,$B12)))
A13:A16A13=INDEX($E$3:$E$21,AGGREGATE(15,6,(ROW($F$3:$F$21)-ROW($F$3)+1)/($F$3:$F$21=$B13),COUNTIF($B$12:B13,$B13)))
B13:B16B13=AGGREGATE(14,6,$F$3:$F$21/ISNA(MATCH($E$3:$E$21,$A$3:$A12,0)),ROWS(B$13:B13))
 
Upvote 0
Sorry, that was my daily brainfart :oops:

Try this one instead.

=AGGREGATE(14,6,$F$3:$F$21/ISNA(MATCH($E$3:$E$21,$A$3:$A12,0)),1)
 
Upvote 0
Works perfectly! Wondering why you choose to use the Aggregate instead of the Large?
 
Upvote 0
Aggregate doesn't need array confirmation and it handles errors better, but mostly personal preference.

Guess you had similar reasons for using Aggregate instead of Small with your formula in A12?
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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