I have got some list of shops. I have to allocate shipments based on their rankings. The allocation should happen in such a way that each shop should not get less than 25 shipments and more than 100 shipments. The actual question is explained below.
Total SHipments=150
Shop Id A B C D E
Allocation (%) 30% 28% 25% 10% 7%
Min. 25 25 25 25 25
Max. 100 100 100 100 100
Actual Allocation %*150
=45 42 37 15 11
My Requirement 45(>25) 42(>25) 37(>25) 25(<25) 1(<25)
So my requirement is based on the ranking, the excel should allocate actual allocation to the top rankers (Between 25 to 100) and as the ranking goes down, it should fulfil the need of better ranker and make it 25 and then allocate the rest.I think I have made the question clear but let me know if still ambiguity is there. I'm new to this community. Forgive me if I'm not able to post the question in proper way.
To get your required results based on the information in your table layed out in the manner in the screen shot below, use the following formula:
=INT(MIN(MAX($C$1*B$5,B$7),B$9))
The above formula is placed in Cell B16. The INT was used as your results for 37.5 was 37.
In cell C16 place the following formula and copy it to the right as required. This is based on the allocation being in descending order from left to right:
=IF(SUM($B$16:B$16)+INT(MIN(MAX($C$1*C$5,C$7),C$9))<=$C$1,INT(MIN(MAX($C$1*C$5,C$7),C$9)),$C$1-SUM($B$16:B$16))
The max function is used to return the minimum value. When your formula returns a result below the minimum value The max function returns the minimum value. The MIN function does the same when the result of the formula exceeds the maximum allowable value. It will return the maximum allowed value as it is the minimum of the two numbers.
UPDATE: Rank out of order
This does not work when their is a tie and total demand exceeds available shipments
I took your table and added a helper row to determine RANK Row 6. I used the following formula to come up with the rank
=RANK(B5,$B$5:$F$5)
With this method, it is possible to have ties. You can investigate how to come up with unique rank with ties. The rest of this solution will assume the there are no ties in rank.
In Row 11 the "demand" of each shop is calculated based on Max and Min constraints and is rounded down to the nearest integer. The following formula is placed in B11 and copied right:
=ROUNDDOWN((MAX(MIN(B5*$C$1,B9),B7)),0)
In row 13 the actually amount to ship or "supply" is determined with the following formula in B13 and copied to the right.
=IF(SUMPRODUCT(($B$6:$F$6<=B6)*$B$11:$F$11)<=$C$1,B11,MAX($C$1-SUMPRODUCT(($B$6:$F$6<=(B6-1))*$B$11:$F$11),0))
FYI - SUMPRODUCT performs array like calculations within it. As a result, avoid using full column/row references such as A:A and instead reduce the range to your data or something closer to it to avoid a lot of excess calculation which may bog down your system. This is particularly true when the formula is repeated in multiple cells.
Related
I have 6 rows of data with a cost:
I would like to select the top data entries whose cost account for e.g. 60% of my total cost. Here, the formula would flag Bananas, Lemons and Oranges since it is the selection that covers at least 60% of the total.
I need to select the largest values first.
In substance, I would like to find a function that does the same as
=INDEX($A$2:$A$12, MATCH(LARGE($B$2:$B$12, D3), $B$2:$B$12, 0))
Any clue?
link to file
In this file, the first column represents the cost, the second is the cumulative sum and the last is the percentage of data covered.
Here is a solution using Microsoft365:
Formula in D2:
=INDEX(SORT(A2:B7,2,-1),SEQUENCE(MATCH(TRUE,((MMULT(--(SEQUENCE(1,COUNT(B2:B7))<=SEQUENCE(COUNT(B2:B7))),SORT(B2:B7,,-1))/B8)*100)>=60,0)),{1;2})
Where MMULT(--(SEQUENCE(1,COUNT(B2:B7))<=SEQUENCE(COUNT(B2:B7))),B2:B7) is used to create a running total array.
This is a little bit complicated to describe, but I will try my best. I have a total, let's say 1000. Then I want to split it by percentages, position count is all the time different. So there can be 3 or 70 or 130 positions or whatever. Then split sum should correspond to target value.
Here is an example of the case:
I input names under Customer request
I enter percentage for position under Percentage
In amount calculation I use =CEILING($C$5*C10;10) and in all the rest of the cells the same to get numbers look nice. It is working fine but he problem is that now totals does not match. It should end up in 15550 but after calculating totals after split it is 15660.
Is there any ideas what kind of master artificial intelligent formula can do the trick to produce nice looking numbers, taking in consideration to match Total (target) in the end if Total (calculated) percentage is 100%?
P.S. Any ideas are welcomed as well. The target is to have nice looking, rounded numbers that will sum in the same number as target - total.
Since you are using CEILING, your output number (e.g. 15660) is guaranteed to be greater than or equal to your input number (e.g. 15550). This is because any time a "perfect match" isn't found, it rounds up.
My first suggestion is to instead use ROUND instead of CEILING. Right off the bat this will perform better than CEILING because ROUND can round up or down but CEILING can only round up.
E.g. try this:
= ROUND($C$5*C10,-1)
Since you provide no details as to "how" the data needs to be adjusted to meet your input value, I can't really provide any automatic solution.
One manual solution is that you can make a new column which indicates whether the data was rounded up or rounded down, and you can adjust the percentages manually to get the data you're looking for.
Here's a formula to tell you if the data is rounded up or down (e.g. put formula in cell E10 and drag down):
= CHOOSE(SIGN(D10-($C$5*C10))+2,"Round Down","Perfect Match","Round Up")
You can use this information to manually tweak your percentages. For example... if your output value is too high, you can slightly decrease some of the higher percentages that "Round Up" and slightly increase some of the lower percentages (e.g. if you have 10% and 3%, maybe change them to 10.1% and 2.9% to see if that makes a difference.)
Not sure if this is possible in a saved search, but I want to run a calculation off the summed summary results and display it on the same line. I have a SUM of quantity column and a SUM of quantity fulfilled. I want another column that does qty fulfilled / qty as a percentage but it has to be calculated at the summary level.
Any help would be greatly appreciated.
formula
results
Basically I want to do the following but based on the summary data only, in order to calculate the total fill rate (fulfilled/qty ordered) rather than an average fill rate per order. I don't know if it's possible in a summary saved search.(NVL({quantitycommitted},0)+NVL({quantityshiprecv},0))/NULLIF({quantity},0)
With the above and with the AVERAGE function, it's giving me the average of the individual order fill rates. I want the aggregate fill rate instead. If there are 10 orders and 9 filled at 90%, 1 at 0%, my current formula gives me 90%. But what if that 1 order had a way higher qty than the other orders? Then it would be misleading to show an average fill rate of 90% because on the order that counted, you missed all the sales.
Here's a similar logic you may use:
((sum({quantityshiprecv})/sum({quantity})) * 100)
#Dars is correct, but I thought I'd give you a picture of what that looks like in the NetSuite UI.
It doesn't matter what fields you Group by, and you can use the Minimum, Maximum, or Average Summary Type for your Formula (Percent) field
I'm trying to take a table of web data (average % of page viewed) and create an average.
This is what my table looks like:
0-25% 954,353
26-50% 58,569
76-100% 73,653
51-75% 31,011
I'm looking to calculate in a cell that the average across all is XX %.
I guess this is what you are looking for:
Due to a lack of more information, we do not know what the actual distribution of the items in the range from 0 - 25% is. Hence, I am assuming that they all average out at 12,5% (the median). If you continue this line of thought then the overall average is nothing but an average of the medians or (looking at the formula) a SumProduct divided by the Sum of all items.
Trying to calculate the total amount based on different discount factors throughout the term. For example, if a base price is $1,000/month, that will be for months 1 – 24, then $500/month 25-48 and $250/month 49 and after. I think I can do this with IF statements but is there a better way to compute this calculation in Excel?
=IF(B2<=$E$2,A2*B2,IF(AND(B2>=$D$3,B2<=$E$3),(24*A2*$F$2)+(B2-$E$2)*(A2*$F$3),IF(B2>=D4,(24*A2*F2)+(24*A2*$F$3)+(B2-48)*(A2*F4))))
Change your table as shown below, and use the following formula:
=A2*VLOOKUP(B2,$D$2:$F$4,2)+A2*(B2-VLOOKUP(B2,$D$2:$F$4,1))*VLOOKUP(B2,$D$2:$F$4,3)
There is no test done for maximum months. You can add that as an IF if necessary.
This method allows for a lot of flexibility in altering the terms. It is also useful in calculating things like income taxes and other stuff for which there is this kind of "tiering"
EDIT: The formula for the Base column:
E2: 0
E3: =E2+(D3-D2)*F2
and fill down from E3 to the bottom of the table