Formula to include quantities in percentile calculation

richard_d1

New Member
Joined
Feb 7, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
We manufacture products and then cut to them to the length customers ask for. I have a sheet containing all our orders, and I'm trying to write a formula to calculate what length 90% of our orders for each product are over. So if we have any offcuts, we know if it's worth saving them or not.

I've done this so far:
Book2
ABCDEFG
1Order NoProductLengthQuantityProduct90%
21001B3.0505A3.100
31002B2.12528B3.606
41003A3.1003C5.155
51004A3.1001
61005B2.4004
71006B2.4006
81007B2.4008
91008B2.20011
101009B3.05010
111010C4.750151
121011C5.20019
131012A1.4004
141013B3.05020
151014B3.60010
161015B3.6602
Sheet1
Cell Formulas
RangeFormula
G2:G4G2=PERCENTILE(IF(B:B=F2,C:C),1-$G$1)

So in column G, it calculates what length 90% of our orders were over.

However, that doesn't take into account the size of the order. How can I change the formula to include the quantity?

Thanks.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I am not clear what is required. May this help.
Excel Formula:
=PERCENTILE(IF(B:B=F2,C:C*D:D),1-$G$1)
It is a better practice to avoid referring full row or column and use specified range.
Eg; Instead of C:C use say C2:C200
 
Upvote 0
I am not clear what is required. May this help.
Excel Formula:
=PERCENTILE(IF(B:B=F2,C:C*D:D),1-$G$1)
It is a better practice to avoid referring full row or column and use specified range.
Eg; Instead of C:C use say C2:C200
Thanks. That doesn't do what I'm after though I'm afraid.

To explain it better, what I want it to do for Product A:
Book1
JKLMNO
1Order NoProductLengthProduct90%
21003A3.1A1.4
31003A3.1
41003A3.1
51004A3.1
61012A1.4
71012A1.4
81012A1.4
91012A1.4
Sheet1
Cell Formulas
RangeFormula
O2O2=PERCENTILE(L2:L9,1-$O$1)

So where the quantity is 3, it repeats that line 3 times. And then takes calculates the percentile.
 
Upvote 0
How about
Fluff.xlsm
ABCDEFG
1Order NoProductLengthQuantityProduct90%
21001B3.055A1.4
31002B2.12528B2.125
41003A3.13C4.75
51004A3.11
61005B2.44
71006B2.46
81007B2.48
91008B2.211
101009B3.0510
111010C4.75151
121011C5.219
131012A1.44
141013B3.0520
151014B3.610
161015B3.662
Sheet6
Cell Formulas
RangeFormula
G2:G4G2=LET(f,FILTER($C$2:$D$100,$B$2:$B$100=F2),q,INDEX(f,,2),x,TOCOL(IF(SEQUENCE(,MAX(q))<=q,INDEX(f,,1),1/0),2),PERCENTILE(x,1-$G$1))
 
Upvote 1
Solution
@Fluff Thanks; that did it! No idea how it works, but it gets the result I'm after.

90% of the Product A's we supplied were over 1.4m.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,876
Messages
6,175,123
Members
452,614
Latest member
MRSWIN2709

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