I have a sheet which I point failures, it is divided by failures (rows) and days (columns), I point the quantity of failures by the type of failure that day. So I used the vlookup to show me the top 3 failures of each day, but there is a problem, when it has the same quantity of different failures, it shows the same failure, not the next one with the same quantity.
I've tried ways to correct this, but everything I found didn't work, because it has variable quantity depending the day, and what I found use the COUNTIF trick, I can't define a value, so it doesn't work.
can anyone help me please?
There's probably an easier way, but this formula should work:
=LET(day,Table1[Sunday],myarray,FILTER(CHOOSE({1,2},Table1[Failure],day),RANK.EQ(day,day)<=3),SORTBY(myarray,INDEX(myarray,,2),-1))
As you can see it returns an dynamic array containing the top 3 Failures in descending order, along with the number of failures.
This should account for any ties as you can see in my example. However, it is possible for the returned array to be more than 3 rows if there is a tie for third place. Not sure if that's desirable or not.
Related
So I'm trying to create an Excel sheet to split the values of 70 items into six groups.
For reference, this is to divide my grandma's estate evenly for her six children. I have approx. 70 items and their appraised values in an Excel sheet, but not sure the best way to go about this. I was hoping to use Solver, but haven't been able to figure it out.
Ideally I could make it so people could pick specific items that they want and run the Excel sheet again to re-balance all the values.
Thanks!
So set this up, based on a thrown together set of values.
Each sumproduct is held to be <= to the (total value / 6)-10. You may want to reduce this to 5 or 2 etc but the smaller you go the harder it is to solve due to the values of the items.
I have done this for 30 items, there is a limit to the number of variables in the Solver - if you hit that then you might consider pairing items, or manually setting some will help, see below.
You might want to add something for sentimental value - I will leave you to consider that.
As for manually setting some items then you can set those items to one, move them to the top or bottom and remove them from the Solver variable cells - that way they won't get changed, but they still need to be included for the value. If the values are similar then they can be taken out if the differences are ignored by the parties.
So, edited the model, see below. Note that 1 item is not allocated. This could be addressed by changing the constraint controlling cells J9:J38 but it comes down to the difficulty of finding an exact solution and that is also why the 10 can be adjusted...
Hopefully the title makes some sense because I'm trying to wrap my head around the logic and I'm not quite sure how to phrase the question.I'll try to give a brief explanation of the end goal without over complicating it with unnecessary details.
I have a table of survey score averages for every month per person and a correlating table with the number of surveys each person received for each month. The logic is essentially multiple the score for each month by the number of surveys, combine them, divide by the total number of surveys within that time period to get their true average. Where things get a little complicated is that I have to include the ability to set a custom date range and return the value. So sometimes I might be looking at the average for Jan - Apr, other times I might just be looking at Feb-Mar etc.
I think sumproduct is going to get what I need done but I'm running into issues trying to write it out. I've written it several different ways and none of them worked so here's one that best conveys what I'm trying to do,
=SUMPRODUCT(--(F7:I7,L7:O7>=C2),--(F7:I7,L7:O7<=C3),--(E8:E12,K8:K12=B9),tbl_average[[Jan-20]:[Apr-20]],tbl_surveys[[Jan-20]:[Apr-20]])
I super appreciate any assistance I can get on this. I'm hoping the end result is not nearly as difficult as I'm making it out to be.
Some additional information:
I'm going to be using this same process to calculate multiple metrics across multiple worksheets.In the test example each of the tables will most likely be on different sheets. The dashboard with the calculated results will contain everyone's names and will be filtered and rearranged frequently, so I need to make sure we're always matching directly to their names and not just the relative rows. Basically, in my example I show that Agent 1 is always lined up on row 8 but that's not always going to be the case. Agent 1 could be in Row 8 on Sheet 1, Row 10 on Sheet 2, and Row 12 on Sheet 3 and I need all the correct values to multiply and sum against one another.
Example data with desired outcome that I need to calculate
I have 12 items of a certain current value. I have a 'soft' cap of $1,000,000 for these values. Some of the items fall above, and some below this cap level.
I have an amount of money (for this example $900,000) that I want to distribute amongst only the items that fall below the cap (in this example 6 items), with the aim of bringing the value of these items up to but not over the cap value.
If I distribute the $900,000 evenly over these 6 items (each receiving $150,000), you can see that items 2 and 9 would then be over the $1,000,000 cap. So items 2 and 9 should only receive $100,000 to raise their value to the cap, then the remaining 4 items would receive and equal share on the remaining pool of money ($700,000 / 4 = $175,000).
So I need a formula to check every item to see if it needs a distribution (i.e below the cap) and then portion/divide out the money pool as illustrated above in the desired distribution column.
Note: The pool of money to be distributed can change. Also the number of items below the cap can change. The cap value itself can change.
I am hoping to avoid VBA or Solver because the spreadsheet could be used on other people's computers.
Hopefully this makes sense. Thanks.
EDIT:
So far I have been able to get close by adding a helper column and using the following formula:
=IF(SUM($F$6:F14)=$D$23,0,E15*MIN(D15,($D$23-SUM($F$6:F14))/SUM(E15:$E$18)))
Working example when values are sorted.
This seems to work when the values are sorted in descending order, as shown in the example image above. But seems to break when the values are a bit more randomly assorted which is likely to happen (as in the original post).
Just to give you an idea of how the solver can be set up to do a capital budget model here is one, also shows the solver and its settings:
I have a problematic table, which is interconnected and goes out of memory often, but I've limited it to show 50 items, but now want to limit it to show only lines that one column calculated. The calculation - one price minus another one. I need to limit the lines so that the % or the value is less than 0 (meaning everything with -% or -<0 is acceptable).
Using a calculated dimension does not let me do an if function to accomplish this. The deduction does not work for some reason.
Any help?
I just edited the formula to "=if(dimension='-' or dimension='0', null(), dimension)". So the kicker was actually setting this all to "null()" so the "Suppress When Value Is Null" recognizes things to null.
This actually solves my problem in a different way, however the goal is the same. This skips the values where a calculation is impossible due to lack from one source.
[UPDATE Jun-3rd-2017]: I figured out exactly what I needed. I just made the calculation on the script side and now a calculated dimension is actually restricting all of the values by the calculated dimension as was intended.
I'm having problems trying to do this formula and it just doesn't work. Can anyone help me?
=IF(JH2="13",CEILING(JD2/0.68+13,0.5)-0.01,""),IF(AND(JH2="6.95",(JD2/0.68))<50,CEILING(JD2/0.68+3,0.5)-0.01,CEILING(JD2/0.68+6.95,0.5)-0.01),IF(AND(M2="CA",ISNUMBER(SEARCH(S2,"INCONTINENCE"))),CEILING(JD2/0.68+6.95,0.5)-0.01,""))
Just a FYI it reads,
IF Freight price is 13 THEN to Divide the Cost price by .68 and ADD the 13.
IF Freight price is 6.95 AND the Cost Price Divide .68 is LESS than $50 THEN add $3.00 ELSE ADD 6.95.
IF M2 (which is Unit of Measurement) has CA AND Column S2 (which is the category) contains the word "Incontinence" THEN calculate Cost Price Divide .68 and add 6.95 Regardless.
Everything is rounded up.
But can't get the Damn thing to work.
First some nagging and whining.
Unreadable source code.
Reference to cells without provided values.
Now the answer (at least a part of it, depending on me missing something else).
If you start breaking up the formula, you'll notice that the first AND has the condition of equality first (that's correct) but then you'll see that the second condition only is a division, whereas the inequality comparison with 50 is put outside.
I believe that's your error. But that's based on the assumption that I got the formula correctly.
As a general suggestion for working with complex formulas in Excel, I usually do a single step at a time (putting the sub-results in separate columns to verify that they're correct). When done and confirmed, I can merge them into a single one.
Try this, it is untested:
=IFERROR(CEILING(IF(JH2=13,JD2/0.68+13,IF(AND(JH2=6.95,JD2/0.68<50),JD2/0.68+3,IF(JH2=6.95,JD2/0.68+6.95,IF(AND(M2="CA",ISNUMBER(SEARCH("INCONTINENCE",S2))),JD2/0.68+6.95,"")))),0.5)-0.01,"")