So, there are different plastic cases: model and inner dimensions (Length x Width x Height). I need find the closest option based on:
inner dimensions which are put in G3:I3 -> the cell J3 should display the closest model
the model of case which is put in the cell K3 and in the cell L3 should find the closest model from other positions in the array.
I have added 3 positions so far but there are thousand+ of them. Would really appreciate if you could help me with that.
I uploaded my excel file to google drive for further reference.
It depends on how you define closest dimensions. For example I created a formula that sums up the absolute deviations of each dimension from the input values of the colored cells and looks for the minimum. Put this into Cell J3 in your example worksheet.
=INDEX(A2:A4,MATCH(MIN(ABS(B2:B4-G3)+ABS(C2:C4-H3)+ABS(D2:D4-I3)),(ABS(B2:B4-G3)+ABS(C2:C4-H3)+ABS(D2:D4-I3)),0))
Array Formula: press CTRL + Shift + Enter to enter the formula
Related
I'm trying to create an Excel-formula that counts the number of times a labeled value is smaller than another value offset down respectively to itself. The image below shows a dataset (left), and a matrix with the labels and offset values (top right). The values E3:H7 are the desired results (plus "/" followed by the number of occurences).
Example E3 means: 4/4 times, value A was SMALLER THAN the next value offset by 1 (a.k.a. the next B).
Another example G4: 2/4 times, value B was SMALLER THAN the next value offset by 3 (a.k.a. the next E)
It would be a combination of COUNTIF and OFFSET i believe, but Matrix-calculations and offset don't seem to work together. I hope anyone can point me in the right direction
I've figured it out. The final formula in E3 (for the value in front of the slash):
=SUMPRODUCT((1*($B$1:$B$20<OFFSET($B$1:$B$20,E$2,0))),1*($A$1:$A$20=$D3))
This is a compound problem to count both the values less than the other values as offsets, and to count the pairs of values being compared.
If you use this formula in Cell E3 and then copy/paste down and across, it should do the trick (the named range Labels is $A$1:$A$20 and the range Values is $B$1:$B$20):
=SUMPRODUCT(--(Values<OFFSET(Values,E$2,0))*(Labels=$D7))&"/"&SUMPRODUCT(--(Labels=$D7)*--(OFFSET(Labels,E$2,0)=OFFSET($D7,E$2,0)))
I have a Google Sheet that has quiz entries. Each correct answer adds points and points will be deducted for wrong answer.
Here I use ARRAYFORMULA(SUMPRODUCT) formula to calculate points. The formula works fine to add points if answer is correct, but I want to deduct points for each wrong answer as an else condition.
My Spreadsheet
In above sheet, I want to deduct -5 point from Q3 for the wrong answer in N3 and calculate the points in O3.
How can I achieve this? How can I add if, else condition to this formula?
O3:
=ARRAYFORMULA(MMULT(IF(L3:N5=L1:N1,TRANSPOSE(P3:P5),TRANSPOSE(Q3:Q5)),TRANSPOSE(COLUMN(L1:N1))^0))
IF to get correct score
MMULT to add corresponding scores
If what you have is working for you, just add another set of sumproduct conditions to the formula already there
=... + ARRAYFORMULA(SUMPRODUCT((L3<>L1)*Q3 + ...)))
In an unused column to the right, put this formula into the third row.
=max(0, arrayformula(SUM(if(L3:N3=L$1:N$1, P3, Q3))))
'if Georges score can be negative then,
=arrayformula(SUM(if(L3:N3=L$1:N$1, P3, Q3)))
Double click the 'fill handle' (tiny square in the bottom-right of the selected cell) to fill down.
have a table that i would like it to select the smallest size picture frame that could be used based on the size values,
basically return the smallest frame that would fit the image.
For example i have 4 standard sizes:
a b c
Size1 150 150
Size2 300 300
Size3 540 570
Size4 800 800
I want to have a size in another cell e.g. 290 x 300 and would like it to pick the smallest size possible to fit i.e. in this case size2.
I've followed a few guides and have the following that will print out the value if the values are exact but not if they are slightly under one of the options
=VLOOKUP($A$8,CHOOSE({1,2},$B$2:$B$5&", "&$A$2:$A$5,$C$2:$C$5),2,0)
Any helo / direction would be much appreactiated!
Thanks
Assuming order does matter (e.g. there is a difference between 500x550 and 550x500), you can use this array formula:
= INDEX($A$2:$A$5,MATCH(2,MMULT((E2:F2<=$B$2:$C$5)+0,{1;1}),0))
Note this is an array formula, so you must press Ctrl+Shift+Enter after typing this formula rather than just pressing Enter.
See below for working example.
Assuming order does not matter (e.g. there is not a difference between 500x550 and 550x500), the formula gets considerably longer because of reversing the order of the E2:F2 array. There is possibly a better way to do this but this is the easiest way I can think of to do it. Unfortunately Excel has no way of handling 3D arrays, otherwise this would be not much different from the original formula above. Anyway, here is the formula (line breaks added for readability)
= INDEX($A$2:$A$5,MIN(MATCH(2,MMULT((E2:F2<=$B$2:$C$5)+0,{1;1}),0),
MATCH(2,MMULT((INDEX(E2:F2,N(IF({1},MAX(COLUMN(E2:F2))-
COLUMN(E2:F2)+1)))<=$B$2:$C$5)+0,{1;1}),0)))
Note this is also an array formula.
See below, working example. Note how it yields the same result as above in every cell except cell G4, since again this is considering 550x500 and 500x550.
It is not clear what is in cell A8. Going by your question, I assume it must be dimensions in the format "W x H" (example: 290 x 300). If so, try:
In D2: 1
// Copy next down
In D3: D2+1
// Wherever you want it
=CONCATENATE("Size ",MIN(VLOOKUP(LEFT(A8,FIND(" ",A8)-1)+0,B2:D5,3,TRUE),VLOOKUP(RIGHT(A8,LEN(A8)-FIND("x ",A8)-1)+0,C2:D5,2,TRUE)))
Alternatively, if you split the width and height into 2 cells A8 and B8, this simpler version should do the trick:
In D2: 1
// Copy next down
In D3: D2+1
//Wherever you want it
=CONCATENATE("Size ",MIN(VLOOKUP(A8,B2:D5,3,TRUE),VLOOKUP(B8,C2:D5,2,TRUE)))
These assume the sizes all use a "Size #" naming convention. If otherwise, you could add another column at the right to equal column A, then use vlookup to identify the match, like this (again assumes "W x H" in cell A8):
In D2: 1
// Copy next down
In D3: D2+1
// Copy next down
In E2: =A2
// Wherever you want it
=VLOOKUP(MIN(VLOOKUP(LEFT(A8,FIND(" ",A8)-1)+0,B2:D5,3,TRUE),VLOOKUP(RIGHT(A8,LEN(A8)-FIND("x ",A8)-1)+0,C2:D5,2,TRUE)),D2:E5,2,FALSE)
I have 3 columns with percentages.
I would like to put an up or down arrow in the same cell as each percentage depending on the previous percentage.
ex: H10 = 54, L10 = 55, P10 = 50
I'd like L10 to read 55 with an up arrow and P10 to read 50 with a down arrow. Then I want to copy this formula down to the 500th rows for columns L and P.
I was able to create this for 1 row (H10, L10 and P10), but when I tried to copy it down to the other rows, it continued to reference the first row (H10, L10 and P10), . I tried to remove the "$" absolute reference and got an error message saying I cannot use relative references. How can I copy this formatting all the way down.
The fields I am using (row H, row L, row P):
Here's what I did to get around this:
I added another cell and calculated the difference between the rows, then set the formula to evaluate if the difference was negative or positive (greater than or less than 0), if it was positive there is an up arrow and if negative there is a down arrow. I made the new row small enough that only the arrow shows and the number doesn't, and I don't have borders on the two rows (the one with the number and the one with the formula) so it looks like the additional row is actually part of the row that has the true value (not the calculation).
There is one way I can think of to get a relative reference while only using what "looks like" an absolute reference.
= $A1
returns the same thing as:
= OFFSET($A$1,ROW()-ROW($A$1),0)
Notice that the formula above uses only absolute references but effectively returns a relative reference.
Try using this method to see if it will work in your case.
I haven't had to use Excel graphs for more than 10 years... and find myself needing to create a simple chart with a series of lines.
Each line will start at (0,0), and then move to the (x,y) points specified.
For example
X,Y
20,5000
25,7500
40,9000
This should have three lines. All of them start at (0,0), and move to the points specified. Ideally, I'd like to be able to specify the max ranges, and have the lines start from (0,0) and keep going until they hit the boundaries.
This should be really simple to do, but I can't recall how, and all my Google search results are assuming I want to do something far more complex.
Any help?
Thanks
You will need to do a bit more processing on your data to get the result you want but I believe it is doable fairly simply
First, identify your maximum X value (in my example I have chosen 20000 (cell (A2))
Then list out the X and Y values for the Series, with their origins (0,0) and their values as listed in your table above (Cells A4 through F5)
You can then copy the maximum value into Row 6 in cells A6, C6, E6 to make the next bit easier to understand.
Then you can use the TREND function to extrapolate from your known data (rows 4, 5) up to your maximum value (row 6)
For Series 1 for example the expression
(Cell B6) =TREND(B$4:B$5, A$4:A$5, A$6, FALSE)
Says, for Y-values B4 and B5, I know the corresponding X-values A4 and A5, so if I also have A6 as the maximum X-value, what would the Y value be? (the False just says the equation must go through the origin)
You now have a table that looks like this
Create a new “Scatter With Straight Lines and Markers” chart and add three data series. Series1 would look like this
Once all three series have been added you now have a chart that shows the lines up to your maximum value for the ratios you have defined above.
Hopefully this is helpful. Let me know if I can be of further assistance.