Formula to Find Next Value in a Column that Contains a Certain Value in another Column - excel

Current Next 1 Apple
2 5 2 Boy
3 Cat
4 Apple
5 Boy
6 Cat
7 Apple
I have cell 1 that contains the value "2". I need a formula that would return the next value in a column that contains the value "oy" in another column. But it cant return the same value, has to return a value greater than the current. So next value greater than 2 that contains "OY" in another column.
Example should return the number 5.
Can anyone help?

Use INDEX/MATCH to set the RANGE and another INDEX/MATCH to return the value:
=INDEX(INDEX(C:C,MATCH(A2,C:C,0)+1):C1040000,MATCH("*oy*",INDEX(D:D,MATCH(A2,C:C,0)+1):D1040000,0))
Avoid using OFFSET or INDIRECT as they are volatile functions.

Related

Index Minif excel

I need a formula that looks for a value in column A, finds the smallest value of that row and displays the corresponding value of a row on the top of the sheet (row 3 in my case) where the smallest value has been found.
also would like to find the second and third smallest value and display the value of row 3.
For example: I need to lookup X in the first column, find the smallest value in that row (1) and display the value on the row on top of that column (D)
and second smallest value for X to display C, third smallest for X to display E.
enter code here
A B C D E F
Z 6 8 9 5 2
X 7 2 1 3 7
Y 9 2 6 1 6
This codes should work:
=INDEX($B$2:$F$2,MATCH(MIN(IF($B$1=$A$3:$A$5,$B$3:$F$5)),INDEX($B$3:$F$5,MATCH($B$1,$A$3:$A$5,0),),0))
!https://imgur.com/2YFu39E
Suppose your data are in range A1:F4 as shown below:
You can use the following formula to find the 1st, 2nd and 3rd smallest value in the row starting "X". Put it in Cell I2 and drag it down.
=SMALL(INDEX($B$2:$F$4,MATCH("X",$A$2:$A$4,0),),H2)
Then you can use the following formula to find the corresponding value in the row starting "Z":
=INDEX(INDEX($B$2:$F$4,MATCH("X",$A$2:$A$4,0)-1,),,MATCH(I2,INDEX($B$2:$F$4,MATCH("X",$A$2:$A$4,0),),0))
It is basic INDEX+MATCH approach. If you have problem understanding the solution, I suggest you to google some online tutorials on the use of INDEX+MATCH. SMALL function is used to find the nth smallest value as requested.
Cheers :)

Return row number from Excel sheet based on filters

I have the following excel file with two sheets namely Sheet1 and Sheet2. Sheet1 contains few names with repetitions like below.
Column E
-------- ----------
Row 3 tom
Row 4 jerry
Row 5 mick
Row 6 tom
Row 7 john
Row 8 mike
Row 9 mick
Row 10 eric
Row 11 matt
Row 12 mike
I want to be able to determine the row in which, for example, the second occurrence of the name "Pete" occurs. For this I have to set up a new worksheet (Sheet2) that will allow me to enter a person's name and a positive integer (such as n), and returns the row in which the name occurs for the nth time.**
Enter Name : tom (cell B1)
Enter Integer :
Result : `2`
For the result cell I have applied the below formula which is returning the no. of times the name occurs.
=COUNTIF(Sheet1!E3:E12,Sheet2!B1)
But I am not been able to find the desired answer.
Can it be done to with Countif, Countifs, Count, CountA, and CountBlank Functions?
Can anyone please help?
=AGGREGATE(15,6,1/(myRng=B1)*ROW(myRng),B2)
Explanation
myRng=B1 match each entry in myRng with the name in B1 giving an array of TRUE;FALSE
1/… changes that to an array of {DIV/0,1,... depending on whether it matches
*ROW(myRng) converts that to an array of {DIV/0, row_num}
AGGREGATE(15,6,resultant_array,B2) returns the nth smallest value from that array, ignoring the errors

How do I make a cell value represent a number in Excel?

I have
Year 1 2 3 4 5 6
I'm trying to make it so that each year number 1-6 is equal to another number value i.e. Year 1 is equal to 5. Year 2 is equal to 6.
You will not be able to store one value in a cell and use a different value for calculation. However you may do this calculation with the help of a lookup from another table,
Assuming you have the years in Column A and the corresponding mappings are in Column E and F, you can use the below formula in Column B,
=INDEX(E:F,MATCH(A1,E:E,0),2) * 2
This formula lookups the value in A1 in the table E:F and returns the corresponding Column F element. That is finally multiplied with the 2 to show your result. Instead of just using just A1 for multiplying by 2, you should be using INDEX(E:F,MATCH(A1,E:E,0),2). Hope this helps.

Excel find next match in table column

I am trying to find the next matching row in a table (not just a range) that matches the current cell's value. I have tried to pass in the column from the next row to the end of the column but cannot get it to work. All ideas are welcome! E.g.
Current idea that doesnt work: =MATCH([#Value],OFFSET([#Value],1,0):[Value])
Example data:
Row Value Next_Match
1 1 #N/a
2 2 4
3 3 6
4 2 5
5 2 #N/a
6 3 #N/a
Try this
=OFFSET(B3,MATCH(B3,B4:B$100,0),-1)
assuming B100 is the last row and you want to match only afterwards... Otherwise use B2:B100 etc
Oh and data is in Columns A,B,C
Although the perfectionist in me rather's
=IF(ISNA(MATCH(B3,B4:B16,0)),"Last",OFFSET(B3,MATCH(B3,B4:B16,0),-1))

Return to a specific value in a column, associated with the maximum value in a row

i'm working with excel, and i'm trying to Fill a column (Column E), with the associated value, where the maximum value of a row exists. as an illustration, Within Row 2(B2, C2, and D2), the maximum value is 7. 7 is exists in Column D, and associated with number 3, thus, the result should be 3.
ABCDE
1 1230
2 0173
3 0532
4 4710
what function should I use and how's the syntax looks like ?
Thank you in advance

Resources