How to write a formula to return best pricing and order qty among multiple price breaks

Marco Mama

New Member
Joined
Mar 2, 2021
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
Hi, I am trying to do an analysis to determine what is the best order qty and pricing considering inventory carrying cost. I put together an example but my file has more than 200 lines.



This table has my source data and calculation to determine what is the best order qty and pricing.

Take PN 1 for example, it is best for me to order at 200 units at pricing of 0.6.

PNOrder QtyPriceBest Order Qty
PN1
100​
0.7​
Yes
PN1
200​
0.6​
Yes
PN1
300​
0.5​
No
PN2
150​
0.4​
Yes
PN2
250​
0.3​
Yes
PN2
350​
0.2​
No
PN2
450​
0.1​
No
PN3
50​
1.8​
Yes
PN3
100​
1.7​
No
PN3
150​
1.6​
No
PN3
200​
1.5​
No

I would like to know how to write a formulate using above input to spit out a table below.
Thanks!

PNBest Order QtyPrice
PN1
200​
0.6​
PN2
250​
0.3​
PN3
50​
1.8​
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Does this do what you want
Book1
ABCD
1PNOrder QtyPriceBest Order Qty
2PN11000.7Yes
3PN12000.6Yes
4PN13000.5No
5PN21500.4yes
6PN22500.3Yes
7PN23500.2No
8PN24500.1No
9PN3501.8Yes
10PN31001.7No
11PN31501.6No
12PN32001.5No
13
14
15
16
17PNBest Order QtyPrice
18PN12000.6
19PN22500.3
20PN3501.8
Sheet1
Cell Formulas
RangeFormula
B18:C20B18=INDEX(B$2:B$12,AGGREGATE(14,6,(ROW($A$2:$A$12)-ROW($A$2)+1)/(($A$2:$A$12=$A18)*($D$2:$D$12="yes")),1))
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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