enter image description here
Hello, how can I create a vlookup or index match to match the exact same date and dimension/page view type? Tried regular vlookup and results do not match with 2nd yellow columns. Also, tried index match and answers #N/A
Can be done with Index-Match. In columns A through C I have the data. In F & G I've written my criteria, and in H2 my formula is:
=INDEX(C:C,MATCH(1,INDEX((F2=A:A)*(G2=B:B),0,1),0))
Related
Name Day 1 Day2 Day 3
John 3 2
John 2 1 4
Using a double Xlookup, when I'm searching for John and Day 2, I cannot get the value 1 and I'm trying Index/Xmatch/xmatch to return me 1 but no luck. Any idea to go about it?
###Updated example picture here###
enter image description here
This is my current formula
=XLOOKUP("John",$A$2:$A$3,XLOOKUP("Day 2",$B$1:$D$1,$B$2:$D$3),,2)
Note that your comments show a different case (wildcard search in names) than your question.
The following formula will result in the first found value of the wildcard search for names starting with the search string in F2 and matching the date in F3:
=LET(range,A1:D3,
c,1-COLUMNS(range),
r,1-ROWS(range),
days,TAKE(range,1,c),
names,TAKE(range,r,1),
data,TAKE(range,r,c),
x,FILTER(data,days=F3),
TAKE(
FILTER(x,
(ISNUMBER(XMATCH(F2&"*",names,2)))*
(x<>"")),
1))
You cannot use XLOOKUP two-way exact match, because it returns the first match and you have duplicated values in column Name.
This solution returns the first non blank value from the input data based on the lookup values. In cell H2 put the following formula:
=LET(colIdx, XMATCH(G3,A1:D1), tb, A2:D5, lkCol, INDEX(tb,, colIdx),
INDEX(TAKE(FILTER(tb, (A2:A5=G2) * (lkCol<>0), "Not Found"),1),colidx)
)
and here is the output:
We use LET for easier reading and composition. First we need to identify the column of our interest. The name colIdx, has the column index. Notice in order to deal with only one data range (tb), I search in all column names including Name. Now we need to identify the corresponding column values. The name lkCol represents that.
Now we have all the elements we need to filter and select the information we are looking for:
FILTER(tb, (A2:A5=G2) * (lkCol<>0), "Not Found")
The output will be the rows from tb for name G2 and filtered for non empty rows from G3 column name. The output has all the columns, now we need to select the column of our interest and only the first non empty value. TAKE extracts only the first row and INDEX the corresponding column.
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
In this sheet, I have a range in B1:C18, where I want to return column C values in G column where all values match with column B with the condition value in E1.
But I'm getting only top value from the Column C but not all (i.e., Sep 2 has two values 443 and 472) but it is returning only 443.
Could anyone look at the formula return in G1 as
={IF(ISERROR(INDEX($B$1:$C$18,SMALL(IF($B$1:$B$18=$E$1,ROW($B$1:$B$18)),ROW(1:1)),2)),"",
INDEX($B$1:$C$18,SMALL(IF($B$1:$B$18=$E$1,ROW($B$1:$B$18)),ROW(1:1)),2))}.
Get the Answers in a column
Ok, I checked and your formula and it is correct too. I have modified it to be an ArrayFormula in the Google Sheets. Just check.
Formula 1
=ArrayFormula(IF(ISERROR(INDEX($B$1:$C$18,SMALL(IF($B$1:$B$18=$E$1,ROW($B$1:$B$18)),ROW(1:1)),2)),"", INDEX($B$1:$C$18,SMALL(IF($B$1:$B$18=$E$1,ROW($B$1:$B$18)),ROW(1:1)),2)))
You can try this formula too -
Formula 2
=ArrayFormula(IFERROR(INDEX($C$1:$C$18, SMALL(IF(E$1=$B$1:$B$18, ROW($C$1:$C$18),""), ROW())),""))
Just copy the formula in the cells of the respective column and you are good to go.
Get the Answers in a single cell
Use this Array Formula for your Google Sheets -
=ArrayFormula(TEXTJOIN(", ",TRUE,IF(B1:B18 = E1,C1:C18,"")))
It will aggregate all the values in a single cell.
Maybe you can try
=iferror(split(textjoin(", ", 1, filter(C2:C, B2:B=E1)), ", ", 1))
and see if that works ?
I have tried a few iterations of Vlookups, Index and Match but can't figure out how to solve the following.
Example Image of the desired result
I have three columns Name, Match Field and Result. I need a formula that will look at the values in Match Field and if the value is found in the Name Column it will Write the name of the Match Field in the Result Column.
I have attached an Image of what I would like the result to be like.
Put this in the Result column (C2)
=IFERROR(VLOOKUP(B3&" *",A$2:B$5,1,FALSE),"")
This will match it properly (first word in column A) but it will bring in the name from Column A.
UPDATE: not a pretty one but will format as required
=IF(IFERROR(VLOOKUP(B2&" *",A$2:B$5,1,FALSE),"")="","",B2)
Hi everyone I have a table of data that contains multiple matches when using vlookup. I was following a lesson that used a combination of vlookup, offset and match to return the second match. However, I am stuck in how I should return the third match.
I know index and match is probably better for this, but I was unable to follow how those expressions work.
My lookup table has 3 columns of data. The first column is a name that repeats with different data in columns 2 and 3. I want to lookup by name and return the content of column 2 and 3.
My expression for the first match is:
Column 2:=VLOOKUP($A3,Sheet1!$J$2:$L$4554,2,FALSE)
Column 3:=VLOOKUP($A3,Sheet1!$J$2:$L$4554,3,FALSE)
The expression for the second match is:
Column 2 data:
=VLOOKUP($A3,OFFSET(Sheet1!$J$2,MATCH($A3,Sheet1!$J$2:$J$4554,0),0,4600,3),2,FALSE)
Column 3 data:
=VLOOKUP($A3,OFFSET(Sheet1!$J$2,MATCH($A3,Sheet1!$J$2:$J$4554,0),0,4600,3),3,FALSE)
How can I use a similar formula to offset for the 3rd match and so on?
Array Formula Requires CTRL+Shift+Enter instead of normal enter
=IFERROR(INDEX(Sheet1!$J$2:$L$10,SMALL(IF(Sheet1!$J$2:$J$10=$A$3,ROW(Sheet1!$J$2:$L$10)-MIN(ROW(Sheet1!$J$2:$L$10))+1),ROWS($1:1)),COLUMNS($A:B)),"")