I am attempting to Index and Match and find the green value labeled in my table below based on the criteria in the yellow cells. Any idea how to go about this, here is my current formula:
INDEX($A$2:$F$31, MATCH($H$3,$B$2:$B$31,0), MATCH($H$4, $C$2:$C$31,0))
It keeps returning the "Type" and not the "Cats" value I would like to have, 0.1518. Would Vlookup + Match be easier? Any help would be greatly appreciated.
Basically, I am trying to match two row variables (City and Type) with the column variable (cats) to get the value. However, if I use vlookup then maybe I can just say go to the cat column instead of matching it with another cell.
Try this formula:
=INDEX(E2:E31,MATCH(1,INDEX((H3=B2:B31)*(H4=C2:C31),0,1),0))
Based on the non-array version of the formula found here: https://exceljet.net/formula/index-and-match-with-multiple-criteria
Related
I have an excel sheet that has data in 3 columns. I am trying to write a function that will search each column for a single value. If it finds the value, I want to output the value of the column where the value was found.
I have this formula currently, which does what I want for a single column, but I do not know how to modify it to search additional columns in the same row.
=IF(ISNUMBER(SEARCH("apples",J2)),J2,"")
I tried modifying it to:
=IF(ISNUMBER(SEARCH("apples",I2:J2)),J2,"")
But then I received an excel error saying #SPILL
I want to search columns I2:J2 for the word "apples" and if found, output the value in cell J2
How can I modify my function to do this?
XLOOKUP() may be best fit for you. Try-
=XLOOKUP("Apple",I2:I10,J2:J10,"Not Found",0)
In case of partial match use match_mode parameter 2 for wildcard character match like-
=XLOOKUP("*Apple*",I2:I10,J2:J10,"Not Found",2)
Try this (in rows 1 TO 10 as an example):
=INDEX($J$1:$J$10, MATCH("apples",$I$1:$I$10,0))
I am trying to make lookups with Multiple Non-Exact Criteria using INDEX-MATCH.
The formual looks like this:
=INDEX(C314:C318;MATCH(1;(D314:D318>=G313)*(E314:E318>=G314);0))
Criterias are: greater or equal to amount X.
Formula works fine, however when using a long list of values, it does not find the best matching value, it finds the first value that matches the criteria.
For example.
Condition 1 is: code "find code equal to 2055516"
Condition 2 is: numerical "find value equal or above 77"
Condition 3 is: alphabetical "find letter equal or greater than H"
In a large dataset where I´ve got many values, it finds only the next best value that matches this criteria. First value that meet that condition would be "80" and "R", however, following values in my dataset, way below, meet much better those criteria with "78" and "I". Problem here is clear I guess.
How can I adapt my formula to look for those much more fitting values that meet my condtions?
Dataset table looks like this:
The formula should return the name "A, B, C, D, E" of the best maching product.
I used a helper column called Helper to rank the letters in Condition 2 alphabetically first using the following formula (drag it down to apply to all rows):
=COUNTIF(Condition_2,"<="&Condition_2)
then use the following formula to find the best match (although it is an array formula it does not need to be confirmed by Ctrl+Shift+Enter):
=INDEX(Product1,MATCH(AGGREGATE(15,6,Helper/((Condition_1>=77)/(Condition_2>="H")),1),Helper,0))
Replace the named ranges in the above formula with the actual ranges in your worksheet.
Replace , with ; as the delimiter in all formulas to suit your system.
EDIT #2
Based on the new scenario, the problem can be solved by AGGREGATE function solely given that the look up value is a number (EAN)
The formula in Cell J2 of my above example is:
=AGGREGATE(15,6,EAN/((DIMENSION=F2)/(LOAD_INDEX>=G2)/(SPEED_INDEX>=H2)),1)
Please note the following are all named ranges which needs to be replaced with the actual range on your workbook:
DIMENSION being B2:B8
LOAD_INDEX being C2:C8
SPEED_INDEX being D2:D8
EAN being A2:A8
If you do not want to show the error #NUM! for no matching result, you can use IFERROR to return a blank cell as shown in Cell J3 of my example. The formula is:
=IFERROR(AGGREGATE(15,6,EAN/((DIMENSION=F3)/(LOAD_INDEX>=G3)/(SPEED_INDEX>=H3)),1),"")
EDIT #3
Please use the following array formula (need to confirm by pressing Ctrl+Shift+Enter) to find the closest match of LOAD INDEX and SPEED INDEX with the help of a Helper column.
{=INDEX(EAN,MATCH(AGGREGATE(15,6,Helper/((LOAD_INDEX/((DIMENSION=G2)/(LOAD_INDEX>=H2)/(SPEED_INDEX>=I2)))=AGGREGATE(15,6,LOAD_INDEX/((DIMENSION=G2)/(LOAD_INDEX>=H2)/(SPEED_INDEX>=I2)),1)),1),Helper/((LOAD_INDEX/((DIMENSION=G2)/(LOAD_INDEX>=H2)/(SPEED_INDEX>=I2)))=AGGREGATE(15,6,LOAD_INDEX/((DIMENSION=G2)/(LOAD_INDEX>=H2)/(SPEED_INDEX>=I2)),1)),0))}
The logic is to first find the closest matches to LOAD INDEX and then find the closest match to SPEED LIMIT from the range with the closest matches to LOAD INDEX.
Again if you do not want to show #NUM! error for no matching result, you can use IFERROR to return the desired result.
Let me know if there is any question. Cheers :)
This might be done through something much smarter, but the following worked for me:
Formula in G2, following the above sample data to return the row with the best match:
=INDEX(A2:A6,MATCH(SMALL(IF(B2:B6-E2>-1,B2:B6-E2+IF(CODE(C2:C6)-CODE(F2)>-1,CODE(C2:C6)-CODE(F2),""),""),1),IF(B2:B6-E2>-1,B2:B6-E2+IF(CODE(C2:C6)-CODE(F2)>-1,CODE(C2:C6)-CODE(F2),""),""),0))
Note Enter as array formula through Ctrl+Shift+Enter
When no criteria matches, it will return an error, you could catch through IFERROR().
I want to concatenate the value of two columns in the current sheet and then result should be compared with the concatenation of two column value in another sheet.
e.g - The entered value in Column W and X in current sheet after concatenation should be compared with the existing value in column Y and column Z(after concat) of another sheet.
I have tried using the formula COUNTIF(Sheet2!CONCAT($W$2,$X$2:$Y$2,$Z$2),A2)>0 and some different alteration in this but it seems COUNTIF has range and criteria as argument and this is string which is causing error.
If you want to compare, a simple '=' will do.
Concatenation can be done using '&'.
in current sheet:
=W1&X1=Sheet2!Y1&Sheet2!Z1
will return TRUE if both concatenations are equal and FALSE if they are not.
To find the value W1&X1 in the entire range, I suggest you use a help column (unless you are willing to write a macro). In the help column of sheet1, you concatenate the values (=W1&X1 - drag down). In the hlep column of sheet2 you do the same. Then you make an additional column to check for matches, by using
=match(ValueHelpColSheet1,HelpColSheet2,0)
This formula returns the row number in which the match is found and an error when the corresponding value is not found. You can replace this error with something else using IFERROR if you want to.
I was not sure how to really create the question...
But the problem I am having is this: I have a list (in rows) that relate to a regulatory document, and after trying to create some sort of for loop or elaborate VLookUp/Index formula, I'm requesting help.
For example:
Now I want to use the rows to find the corresponding section in the document. I've already extracted and formatted the compliance document so it is in excel format.
So what I really need is this: a formula or VBA script that can
1. take the compliance number (for example 1A-1 which exist in Cell A3) and go find a cell (in single column D) that has JUST 1A-1, not 1A-1.1, not 1A-1.1.2, etc. and return it to the adjacent cell to 1A-1, for example.
Many thanks ahead of time... I am so lost!! :/
VLOOKUP vs INDEX/MATCH
You can do the 'lookup' two ways (that I'm aware of):
Using VLOOKUP:
The B3 cell contains your formula
=IF(ISERROR(VLOOKUP(A3,C:D,2,FALSE)),"",VLOOKUP(A3,C:D,2,FALSE))
where 'FALSE' is indicating there has to be an exact match and the data doesn't have to be sorted.
Using INDEX with MATCH:
The F3 cell contains the Index/Match formula
=IF(ISERROR(MATCH(A3,C:C,0)),"",INDEX(D:D,MATCH(A3,C:C,0)))
where '0' is indicating there has to be an exact match and the data doesn't have to be sorted.
INDEX/MATCH preferable!?
The MATCH function finds the position (row number if whole column is used) of the found match. This way (there's another) of using the INDEX function uses exactly this found match to return a cell's value in that position (row) in ANY specified column range (column). So they are the ideal combination.
With the VLOOKUP function you have to additionally specify the column index (range_lookup) of a range which could get complicated when the columns aren't adjacent as in this case. Most importantly, the function doesn't work if the lookup data is to the right of the match data.
VLOOKUP NOT WORKING! INDEX/MATCH STILL WORKING!
try this formula
The formula in cells
B2: =INDEX(E:E,MATCH(A2,F:F,0))
C2: =INDEX(G:G,MATCH(A2,F:F,0))
MATCH(A2,F:F,0) is finding Cell A2 in column F (0 means it will find
exact match) and will return the first row number when it would find that
INDEX(E:E,MATCH(A2,F:F,0)) will return contents of column E where row number is returned by the Match formula
I am looking for returning multiple column values using multiple matching criteria.
Attached is a screenshot of sample sheet, which have my criteria on cell's B1 & C1.
So basically, when matching 2 criteria (example "Team1" & "low"), it should return columns header (example Name10 & name14) from the header ranger C3:N3.
I have tried a couple of formulas, and is is how far I gone: =INDEX($C$2:$AL$2,SMALL(IF(($A$3:$A$21=$B$1)*($B$3:$B$21=$C$1),ROW($A$3:$A$21)-ROW($A$3)+1),ROW(1:1)))
I am not sure what is missing?
enter image description here
enter image description here
Thanks in advance
Fox
First of all, in your example you point out row 3 and 4 but only one of the specified criteria are matched in this rows: low, because Team4 specifyed in the criteria it's not matched, so i will consider you are looking to match one OR both the criteria specified.
The only way i can imagine for do this with a formula is to use a formula like this
=SE(C3<>0;$C$2&", ";"")&SE(D3<>0;$D$2&", ";"")&SE(E3<>0;$E$2&", ";"")&SE(F3<>0;$F$2&", ";"")&SE(G3<>0;$G$2&", ";"")&SE(H3<>0;$H$2&", ";"")&SE(I3<>0;$I$2&", ";"")&SE(J3<>0;$J$2&", ";"") 'and so on...
where SE() it's function IF() in my language, with this formula in a column on the right of the table (for example col O) you will have a list of the names of that row where the corresponding number is different from 0...expand the formula down for all the rows and then, with a formula like this
=SE(O(A1=A3;B1=B3);O3;"")&SE(O(A1=A4;B1=B4);O4;"")&SE(O(A1=A5;B1=B5);O5;"")&SE(O(A1=A6;B1=B6);O6;"")&SE(O(A1=A7;B1=B7);O7;"") 'and so on...
with the function O() corresponding to OR() you will concatenate the strings (names) of the rows that match one OR both the criteria. If you whant to match both the criteria you should use AND() instead of OR().
The problem of this approach is that the formula becomes very long if you have a lot of names and a lot of rows, and if you add rows you have to modify the formula. Another problem is that if you match the same name more times it will be repeated in the list that the formula outputs...and the list of the names ends with a comma.
In fact, i can't tell that this is a good way for obtain what you need, but it's the only i can imagine only with formulas.
If you should use a macro the problem would be solved better and in a more flexible way, should you?