I 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.
So far I have a vertical array formula that can select the smallest frame that will fit the size requirements but I have one column that I would want to stay static i.e another match that would only give the results from the selection with the same type ID/
My current formula is as follows:
= INDEX($A$2:$A$16,MATCH(4,MMULT((I2:L2<=$B$2:$E$16)+0,{1;1;1;1}),0))
At the minute i am just referencing the type as another lookup but i would like to have it so it will only attempt to match ones with the corresponding type, currently if the size is larger than availible within the correct type it will select a type that has that size availible.
I’ve tried to show what i mean in the screenshot! I want it to only pick up type 1 but it is selecting type 3 because the mmult is seeing that is the only one that would fit.
Help is much appreciated!
Thanks!
If the frame sizes to be looked up are in ascending order, you could use something like this
=INDEX($A$2:$A$4,MIN(IF((($B$2:$B$4>=F2)*($C$2:$C$4>=G2)*($D$2:$D$4>=H2)),ROW($C$2:$C$4)))-1,1)
based on this sort of data layout
Ended up using a load of nested if statements to section of the types to make it simpler to code
Thanks anyway peeps!
Related
I am trying to create a calculated column that flags/counts the changes in values across rows in another column, in Spotfire. Below is an example of the data types I'm looking at and the desired results.
My hope is that for each Location, and ordered along Time, I can identify when the values of "colors" changes and have running count so that each cluster of similar values between changes is given the same label (Cluster Desire 1) for each Location. It would be best if the running count of clusters can restart at each location but this is not crucial. Any help would be more than appreciated!
I thought of a way to do it, relying on one intermediate column (I used two just to make it a bit clearer).
First: the concatenation of values for each row within its Location: called [concatString]
Concatenate(Concatenate([Color]) over (Intersect([Location],AllPrevious([Time]))),', ')
Spotfire defaults to comma followed by space as a separator: I could not find a way of changing that in this kind of expression.
Then within each [concatString] I remove repeated values. The complication is that the last one did not have the comma+space, and I did not manage to make the regular expression I am using understand that. So my workaround was to add a final comma+space to [concatString]. Hence the extra Concatenate(..).
The formula for the column without repetitions, [consolidatString] is:
RXReplace([concatString],"(\\w+\,\\s)\\1+","$1","g")
Then what we have achieved is an individual value for each line we want to group. We can then simply rank [consolidatString] to achieve the desired column:
DenseRank([consolidatString],[Location])
I'm not able to take the means for a large dataset given that the amount of attributes is irregular.
I have posted a simplified case for the problem. It explains the problem very well.
An idea that I came up with: Make a filter to condition on a single attribute. However, still, I don't see a way to do this in an efficient way (other then doing it all by hand).
see excel file:
All help is much appreciated.
I'm basically looking for a function/method to achieve taking means of all different attributes conditioned on each person for a large dataset without doing it by hand.
You can use AVERAGEIFS() inside an IF:
=IF(OR(A2<>A1,B2<>B1),AVERAGEIFS(C:C,A:A,A2,B:B,B2),"")
the ifrst part of the if tests whether the row starts a new group either by the person or the attribute changing. Then it uses AVERAGEIFS() to return the correct average of that group. otherwise it returns a blank
What you want to do can be accomplished very simply with a pivot table.
Simply select one of the cells inside the range of data you want to process(See the video for general use of a pivot table https://www.youtube.com/watch?v=iCiayB6GrpQ )
go the insert tab and insert pivot table.
Once you have it, simply check people, attribute, and values. Then drag people and attribute into rows, drag valut into the values window, select the drop down list and change it from sum of value to average and you should be done. https://i.stack.imgur.com/nYEzw.png
I have been working on a small project. I am trying to display all the results in the same row without NULL values. I've written a small expression to remove the Null values already "=IIF(IsNothing(Fields!RegisterNo.Value),True,False)". However, the rows seem to be moving one level down as it is displayed in the picture ResultMatrix1. I want the results to be on the same level. Can you please tell me if this is possible and how I can achieve it. Is it something to do with the groupings or something else?
Design Groupings
By default, when you create a table, there is a Row Group called "Details" that is not actually grouped by anything. This causes it to produce one row for each row from the dataset. Since you are trying to group these, you need to make sure that innermost group is grouped by your Staff Ref No.
In the lower-right cell, you may need to change the expression to use a Max function. This will simply avoid arbitrarily showing blanks when they happen to be sorted before a real value within that group.
Basically I am trying to improve a spreadsheet that current uses fixed IF functions within IF functions to determine where to find data, then originally used the VLOOKUP function to return the appropriate cable cleat size. Where "Cleat Diameter">"Cable Diameter".
I've been using this for a while, however excel quickly runs out of resources with all the remaining calculations being performed. As a result, I've opted to put all data a single table, and try to use the match function to retrieve the necessary row. Then Simply use the =INDIRECT function to retrieve data from the appropriate column of the associated row.
Unfortunately I believe the issue relates to the fact that I first need to perform at MATCH Type 0 (exact match), followed by a type -1 for the size to identify the next size up that can accommodate a specific cable size.
I've managed a simple lookup on another dataset using (for exact matches):
=MATCH($B3,'Current Raw Data'!A:A,0)+ROW('Current Raw Data'!A:A)-1
However when I attempt the same thing with two types of matches I get errors. The closest I get it using the following array formula, but it does not work unless the data set is arranged so that the contents of Cell C3 is the first occurring item in the dataset in column A:A:
{=MATCH(C3,($B3='Lookup - Cleats'!A:A)*('Lookup - Cleats'!B:B),-1)}
Main sheet:
Dataset Example:
With this array formula (click Ctrl + Shift + Enter together inside formula bar), you should be able to get your results:
=IFERROR(INDEX('Lookup - Cleats'!C$3:C$26,MATCH($B3&$C3,'Lookup - Cleats'!$A$3:$A$26&'Lookup - Cleats'!$B$3:$B$26,0)),"")
I tried my best to use your data setup but maybe miss one or two things that you will need to adjust accordingly. Let me know if this is not working.
enter image description hereenter image description here
According to given data table, I want to find out the top 10 students on the basis of marks (by using excel query) but I think Max function is not working here. kindly suggest.
You can use Large with Match and Index to get the list:-
See the image of my example. I have used dummy values.
Step1 :- Use this formula (I have used in D column 'Top 10')
=INDEX($A$2:$B$13,MATCH(LARGE($B$2:$B$13,ROW(1:1)),$B$2:$B$13,0),1)
Step2:- Then drag this formula down for 10 rows. You will get the top 10.
Let me know if you have any questions
Try the rank functions.The original RANK has been deprecated. You can use RANK.EQ instead.
The syntax is
=RANK.EQ(value, entireRangeOfValues).
e.g. =RANK.EQ(J2,$J$2:$J$8015,0)
The last parameter allows you to specify sort order.
Depending on your needs you can also look at RANK.AVG
These differ in how they rank duplicate values.