In Excel how can you return the highest value in an adjacent subset based upon a criteria from an adjacent subset? - subset

Rating
I am currrently using ={INDEX(N8137:N8140,MATCH(MIN(ABS(J8137:J8140-$J$8132)),ABS(J8137:J8140-$J$8132),0))} .Based upon the criteria set at the top of Column 'J' (1.000) , I want to return the highest value in 'N' that is within the range of +/- 4.3% in Column 'J' with the result retuned in column 'S'
The first set of 4 returns correctly (100.10%) BUT the second set off 4 returns 95.66%. I guess my formula is finding nearest in Column 'J'

Related

min & max value in range in loop

I've faced huge problem with my macro. I have data that contains colums with quantities and values of stock like this:
What I'm trying to achieve is:
to go through every row until the very last, locate quantity (colums with Q letter) and values (colums with V letters) below 0, then adding these quantities below zero to the maximum quantity within the row and adding these values below 0.
to find values within age category for every row that have no corresponding quantity (see cell B4 as example) and add these values to the maximum value within the row.
Why VBA for something you can achieve with a formula?
Let me show you how I calculate the maximum of a list of cells, referring to a column, whose name starts with a "V":
=MAXIFS(A2:F2,A1:F1,"V*")
Screenshot:
Explanation:
Take the maximum of the values on the second row (A2:F2)
The criteria you need to take into account refer to the first row (A1:F1)
The criteria is that it should start with a "V".

Excel - Formula to find consecutive column that fulfills condition & Return Column Header

I'm having trouble for formula to return column value. Where the number 1 has appeared 2x in a row, in this case need for fill formula for Column C.
While for column B I have used the Max Frequency formula
need formula in Column C
Thanks in advance
You could use Excel's texts functions; first CONCAT all cells with '0' and '1' (from you range), then FIND first occurrence of '11' (and arithmetic add +1 to the result) and you have desired number of week.
Now last more CONCAT with text 'Week_' and optional wrap it all with IFERROR to not show error output if occurrence of '11' is not found.
Excel formula (without IFERROR):
CONCAT("Week_",FIND(11,CONCAT(D2:M2))+1)
Be aware that all cells in searched range D2:M2 must be non empty (either it has be '0' or '1')

Excel: How to find highest value in range based on adjacent cells with the same value

I have a column A with names (with duplicates), column B with language codes, and column C with numeral values.
I am struggling to make a formula that would find the highest value in column C, but only for those rows that have the same name – and return the value of column B for the row with that highest value for each unique name in column A. The output should be in another columns, like this:
I think this is what you're looking for:
=INDEX($B:$B,MAX(IF(($C:$C=MAXIFS($C:$C,$A:$A,$E2))*($A:$A=$E2),ROW($C:$C),"")))
Enter the formula in cell F2 with ctrl + shift + enter since it's an array-formula.
I search for the maximum value in column C if the value in column A equals the value in the cell in column E on the same row.
Then I check whether each value in column C equals that maximum value and check whether the value in column A equals the value in column E. If both are true return the row numbers of these en search for the maximum value of these row numbers.
The outcome is the row number of the maximum value that equals the name you searched for.
Using index results in the position of that row number in the desired column (B).
If you're using office 365 you can type =UNIQUE(A:A) in cell E2 to get the unique names listed (prior to adding the formula mentioned above in F2

How to get nth non-blank column in Excel

I want to use an excel spreadsheet to lottery off a set of items amongst multiple contenders. I made a sheet with a column for the item and one for each contender. On each row, the first column has the items name and each user puts a "y" in his cell if he has interest in that item:
Item -A-B-C-D-E-F-G-
Foo - -Y- -Y- -Y- -
Bar -Y-Y-Y- - - - -
Roll -Y- -Y-Y- - -Y-
I then added a column which counted the amount of contenders with a formula like:
COUNTA(Table2[#[A]:[G]])
And another column to choose a random number amongst the contenders with a formula like:
=CEILING.MATH( RAND()*[Amount of contenders cell])
The issue is: Once I have the index of the contender who won, how can I display the name of the winning contender based on the index of which Y was selected?
I solved this by making another table right next to the first table with a column for each contender. The value of each cell = how many "Y" (or non-blank cells) occur upto and including the current contender. The formula for each cell is:
The first column simply is equal to if the corresponding cell is blank: 0 otherwise: 1
=IF(ISBLANK(Table2[#A]),0,1)
And the subsequent columns equal to the previous column + the formula above:
=IF(ISBLANK(Table2[#B]),0,1)+K2
I now have a soon-to-be-hidden table corresponding my original table which looks like this;
A-B-C-D-E-F-G
0-1-1-2-2-3-3
1-2-3-3-3-3-3
1-1-2-3-3-3-4
Once I have this table, I can successfully use match and index to get the name of the 3rd contender for the given row. First I get the absolute index of the n-th non-blank column (the last parameter: 0 indicates that I want an exact match, which gives me the first occurrence of "n" in my helper-table for that row:
=MATCH(Table2[#[Snapshot of lottery results]],K2:P2,0)
And then using that index, I can get the name of the winning contestant (where B1:H1 contains the column names and the cell at column J:current row contains the decision index:
=INDEX($B$1:$H$1,1,IF(J2>0,J2,""))

find average for multiple values in rows and columns in Excel

I need a formula to find average for values if column value in 1:1 matches 15 and row value in A:A matches 750 for example,
here is a screen shot for the table
Using simoco's setup you could also use an "array formula" with AVERAGE function, i.e.
=AVERAGE(IF((A3:A17=750)*(C1:M1=15),C3:M17))
confirmed with CTRL+SHIFT+ENTER
Try this one:
=SUMPRODUCT(C3:M17*(A3:A17=750)*(C1:M1=15))/SUMPRODUCT((C3:M17<>"")*(A3:A17=750)*(C1:M1=15))
where
A3:A17 address of values in your column A:A
C1:M1 address of values in row №1
C3:M17 entire target range
First part SUMPRODUCT(C3:M17*(A3:A17=750)*(C1:M1=15)) gives you sum of all values from range C3:M17 where corresponding value in column A equals to 750 and corresponding value in row №1 equals to 15.
Second part SUMPRODUCT((C3:M17<>"")*(A3:A17=750)*(C1:M1=15)) gives you count of all non empty cells in target range C3:M17 where corresponding value in column A equals to 750 and corresponding value in row №1 equals to 15.

Resources