Add a reference to relate to an Index Match Formula - excel-formula

QUESTION, How can I add a reference to this Index Match Formula?
Index Match Formula # I23, obtains 'Variant Image'.
This is the Index Match formula used at I23 =INDEX(I4:I18,MATCH(D23&F23&H23,D4:D18&F4:F18&H4:H18,0))'
PROBLEM
This formula needs a reference to find the options specific to itself # B23
If there is no reference , products # B4 # B13 cannot be differentiated because their variants are the same
IMAGE: The Index Match Formula Needs a reference

This was very easy to solve, I just added the cell and column I wanted to reference. The answer is,
=INDEX($I$4:$I$18,MATCH(B23&D23&F23&H23,$A$4:$A$18&$D$4:$D$18&$F$4:$F$18&$H$4:$H$18,0))

Related

Return multiple matches when range is dynamic

I have a column which is a dynamic named range:
A
A
B
C
A
How can I apply a MATCH or other formula which returns the row or cell address of all A values in the dynamic named range?
A dynamic named range is used so all row or address of A values can automatically appear as a spill rather than having to drag down the formula.
I have seen numerous formulas in this structure:
=INDEX($B$2:$B$8, SMALL(IF($A$11=$A$2:$A$8, ROW($A$2:$A$8)-ROW($A$2)+1), ROW(1:1)))
However, most of these seem to return the first instance (row or cell address of the first match) and requires the formula to be dragged down manually rather than a spill, which is more preferable.
Any help will be greatly appreciated.
Use FILTER:
=FILTER(ROW(A1:A5),A1:A5=C1)
This will return the Row number everywhere they match.
From there it is pretty easy to include that in INDEX:
=INDEX(B:B,FILTER(ROW(A1:A5),A1:A5=C1))
If you do the full column in the index, you do not need the ROW($A$2:$A$8)-ROW($A$2)+1 as returning the actual row instead of relative works just fine.
Try something like =SORT(ROW($A$1:$A$5)/($A$1:$A$5=$C$1)). This will get you the matches of a value in C1 with a spill formula, leaving behind #DIV/0 errors
See example below:
Other answers that you might be able to take ideas from are here: Match Exact Row Number of Nth Largest Value In Data With Duplicates
You could be thinking of:
=SMALL(IFERROR(ROW(A1:A5)*MATCH(A1:A5,C1,0),FALSE),ROW(A1:INDEX(A:A,COUNTIF(A1:A5,C1),)))
Where your data start in A1 and your compare value is in C1.
If you have Excel 365, this is easier:
=INDEX(SORT(ROW(A1:A5)*MATCH(A1:A5,C1,0)),SEQUENCE(COUNTIF(A1:A5,C1)))
or better yet:
=LET( dataRange, A1:A5,
compareTo, C1,
INDEX(SORT(ROW(dataRange)*MATCH(dataRange,compareTo,0)),SEQUENCE(COUNTIF(dataRange,compareTo))) )

Excel VBA/Formula to find a cell that includes search term?

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

Excel formula that combines MATCH, INDEX and OFFSET

I am having trouble with an Excel-function.
On sheet A I want to get the value of a cell that is located x-columns to the right of cell F2.
X is a variable number and is determined by the value of cell A1. Currently, the value is 5.
=(OFFSET(sheetA!F2,0,sheetA!A1))
This formula works. However, I want to include this function into a MATCH and INDEX function that is located on another sheet (B).
I know that I can use the following formula to get value of $F$2
INDEX(sheetA!F:F,MATCH(sheetB!C4,sheetA!A:A,0))
Combining them, results in the following formula:
=INDEX((OFFSET(sheetA!F2,0,sheetA!A1)),MATCH(sheetB!C4,sheetA!A:A,0))
This formula generates a #REF!-value.
If I evaluate the formula, I see the following steps:
=INDEX((OFFSET(sheetA!$F$2,0,5)),MATCH(sheetB!C4,sheetA!A:A,0))
=INDEX((sheetA!$K$2),MATCH(sheetB!C4,sheetA!A:A,0))
=INDEX((sheetA!$K$2),MATCH("BTC",sheetA!A:A,0))
=#REF!
Why do I want to use MATCH and INDEX?
Because while the values on sheet A are "fixed", the values of sheetB!C4 are floating/variable. Therefore, I need to locate the correct row first. The correct column can be done with the offset-part.
Thank you for your help.
Try this
=INDEX((OFFSET(SheetA!F:F,0,SheetA!A1)),MATCH(SheetB!C4,SheetA!A:A,0))
Syntax of INDEX is
INDEX(array, row_num, [column_num])
where, array is range of cells. When you use =INDEX((OFFSET(sheetA!F2,0,sheetA!A1)),MATCH(sheetB!C4,sheetA!A:A,0)), (OFFSET(sheetA!F2,0,sheetA!A1)) returns sheetA!$K$2 which is a cell not a range.

Giving specific values of a cell reference INSIDE lookup array parameter of MATCH function

I want to know column number of a particular text within an array in a sheet.Hence i used the MATCH function
=MATCH (lookup_value, lookup_array, [match_type])
The 2nd Parameter expects a lookup_array.Eg of a valid input: C5:N5
I dont want to specify "C" as the starting column of the array nor Row number 5 as the row number.I want it to be dynamic.I want to give a absolute column number & absolute row number.
Is there any way to do this.I have tried a lot in vain.
If your dynamic cell references are in A1 and B1 this should work...
=MATCH(0,INDIRECT(A1):INDIRECT(B1),0)

Excel formula only using first value in column on another worksheet

In B2 I have text to search within, in C2 I have this formula to search for words on a worksheet called "keywords" to match against.
{=
IF(B2="","",
IF(ISNUMBER(SEARCH(keywords!$B$2:$B$5,B2)),"Fruit",
IF(ISNUMBER(SEARCH(keywords!$C$2:$C$5,B2)),"Nature",
IF(ISNUMBER(SEARCH(keywords!$D$2:$D$5,B2)),"Vehicle",
"no match"))))
The formula is only using the first keyword in B2, C2, D2 on the keywords worksheet, and not through B5, C5, D5. What is the correct formula?
I understand the result will be the last satisfied statement if more than one match is found. Please help!
formula
keywords
For a non CSE array use sumproduct:
=
IF(B2="","",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!B$2:B$5,$B2))*1)>0,"Fruit",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!C$2:C$5,$B2))*1)>0,"Nature",
IF(SUMPRODUCT(ISNUMBER(SEARCH(keywords!D$2:D$5,$B2))*1)>0,"Vehicle",
"no match"))))
For a slightly shorter formula that uses the title row on the keywords sheet as the return value, so no need to hard code the values. Use this:
=INDEX(keywords!$B$1:$D$1,AGGREGATE(15,6,(COLUMN(keywords!$B$2:$D$5)-COLUMN(keywords!$B$2)+1)/(ISNUMBER(SEARCH(keywords!$B$2:$D$5,B2))),1))
The ranges can be expanded to allow for more rows or columns in the future, without the need of adding more IF statements.
Try:
{ =
IF(B2="","",
IF(MAX(IFERROR(SEARCH(keywords!$B$2:$B$5,B2),0))>0,"Fruit",
IF(MAX(IFERROR(SEARCH(keywords!$C$2:$C$5,B2),0))>0,"Nature",
IF(MAX(IFERROR(SEARCH(keywords!$D$2:$D$5,B2),0))>0,"Vehicle",
"no match")))) }
The issue is that the search within your formula is looking a for a single value to search for within a specified text string therefore when you select the range $B$2:$B$5 it selects the value in the first cell of the range of cells.
Rather then using the SEARCH function use MATCH function with a Match Type of 0 for and exact match. NOTE: this does not need to be an array formula.
Example:
=IF(B2="","",IF(ISNUMBER(MATCH(B2,keywords!$B$2:$B$5,0)),"Fruit",IF(ISNUMBER(MATCH(B2,keywords!$C$2:$C$5,0)),"Nature",IF(ISNUMBER(MATCH(B2,keywords!$D$2:$D$5,0)),"Vehicle","no match"))))
Also your statement "I understand the result will be the last satisfied statement if more than one match is found. Please help!" you may have meant the first satisfied not the last; which would be correct.

Resources