This tutorial demonstrates the key strengths of Excel's INDEX / MATCH function that make it superior to VLOOKUP. You will find a number of formula examples that will help you easily cope with many complex tasks when VLOOKUP fails. Continue reading
by Svetlana Cheusheva, updated on
This tutorial demonstrates the key strengths of Excel's INDEX / MATCH function that make it superior to VLOOKUP. You will find a number of formula examples that will help you easily cope with many complex tasks when VLOOKUP fails. Continue reading
Comments page 18. Total comments: 614
Hi,
I am trying to return multiple values using multiple lookup values. I have a range of lookup values, and I need to list the information from another sheet for each instances the any one of those lookup values appears on my data sheet. Suppose I had X,Y,Z for lookups, and I multiple data points for X,Y,Z on a another sheet. I need to create a single list that will show each entry that appears on the second sheet for any of X,Y,or Z. My current formula is:
=IF(ISERROR(INDEX(Data!$A$1:$E$10000,SMALL(IF(Data!$D$1:$D$10000=Formulas!$A$2,ROW(Data!$A$1:$E$10000)),ROW(Data!1:1)),1)),"",INDEX(Data!$A$1:$E$10000,SMALL(IF(Data!$D$1:$D$10000=Formulas!$A$2,ROW(Data!$A$1:$E$10000)),ROW(Data!1:1)),1))
That works fine, except that I have a list of 34 lookups in addition to Formulas!$A$2. Currently, it will only give me all the entries for the first lookup in my list. I can't figure out how to list the entries for the first lookup, then the second, etc.
Thanks for any help you can provide.
found the answer to my second question - it was my fault - had closed parenthesis in the wong place - so while formula was syntactically ok, it returned a wrong result.
Thanks for the article which is a very helpful introduction into using index/match.
One of the most interesting use cases (for me) is (or would be) using this index/match for looking up data in a (MS Excel) TABLE that resides not in the same, but in a different work book.
I have played around with this and achieved some results, but also found that data is not refreshed and/or even not found anymore when the data in the table changes. My first question would be "what is the right syntax to use? and do I need a 2-way index/match for this or not"? So making up a simple example to illustrate:
My workbook with the table holding the data is called 'CustomerFile.xlsx'. The table is located in tab sheet 'customers' and is called 'Table_Customer'. The columns on the table are: 'Customer ID' and 'Customer Name'. The table has two rows:
Customer ID Customer Name
-------------------------
1 John
2 Marc
My workbook into which the result should be pulled is called 'CustomerRpt.xlsx'.
So what formula would I be using to get the name of customer with ID 1 WHEN SPECIFICALLY WANTING TO USE TABLE AND COLUMN NAMES (rather than column references like $A:$A).
=INDEX ('CustomerFile.xlsx'!Table_Customer[Customer Name], Match(1, 'CustomerFile.xlsx'!Table_Customer[Customer ID],0))
OR
=INDEX ('CustomerFile.xlsx'!Table_Customer[#Data], Match(1, 'CustomerFile.xlsx'!Table_Customer[Customer ID],0), Match("Customer Name", 'CustomerFile.xlsx'!Table_Customer[#Headers],0))
My second question would be: "Any idea why sometimes a correct result is only returned when re-typing the complete formula from scratch?" Note: I am re-tying the EXACT same formula. I am aware the workbook with the source data needs to be open and I have tried refresh/refresh all, formula automatic refresh turned on, saving the file and coming back in, editing link and update values, but only retyping the formula brought back the correct result! So is there any caching going on?
Thanks
A B C D E F G H
1 X AXN Ali 11.11 AXX Ahmed 10.19
2 X AXT Hassan 13.19 AX9 Brian 11.11
3 Y AXX Ahmed 10.19 AXP Shah 0.0
4 Y AX9 Brian 11.11 AXN Ali 11.11
5 Y AXP Shah 0.0 AXT Hassan 13.19
Please help:
Compare the value from Column "F" with Column "C" and on perfect match paste the corresponding average from Column "E" to Column "H". For example: AXX (F1) matches with C3 where the corresponding average is 10.19 and auto pastes it to last column i.e. H (H1)
I have been practicing the formulas that (Look Up with Multiple Criteria Using Index/Match and Vlookup. and I have learned other two ways to lookup using index and match:
=INDEX(Table9[[Customer]:[Qty.]],MATCH(1,((Table9[Customer]=B14)*(Table9[Product]=B15)),0),3) >Yours.
=INDEX(Table9[[Customer]:[Qty.]],MATCH(B14&B15,Table9[Customer]&Table9[Product],0),3) _ Index/Match with &
and using nested If function:
=INDEX(Table9[[Customer]:[Qty.]],MATCH(B14,IF(B15=Table9[Product],Table9[Customer]),0),3)
and the vlookup function with &:
=VLOOKUP(B14&" "&B15,Table9,4,FALSE)
these 3 formulas give the same results and I just want to share them.
)))
thank you for your time you put on explaining excel.
my best wishes.
please anybody resolve my problem.
SHEET 1
A B
DATE NO.
01-May-10 R/RES-105255
02-Apr-14 R/RL-813301
21-Jul-10 R/RES-148991
02-Apr-14 R/RL-813301
27-Oct-12 R/RL-557675
21-Jul-10 R/RES-148991
23-Jul-09 R/RES-100983
30-Sep-12 R/RL-614014
27-Mar-15 R/RL-574613
27-Mar-15 R/RL-574563
01-Jan-09 R/NN-53444
04-Mar-15 R/RL-950289
05-Feb-14 R/RES-100983
01-Jan-09 R/NN-70988
30-Sep-12 R/RL-614014
30-Mar-15 R/RL-616791
05-Jun-13 R/RL-610994
11-May-11 R/RL-143811
16-Feb-14 R/RL-824415
01-Jan-09 R/NN-109879
09-Nov-11 R/RES-30872
01-Aug-13 R/RL-707247
19-Jun-13 R/RL-727757
SHEET 2
A
NO.
R/RES-105255
R/RL-813301
R/RES-148991
R/RL-813301
R/RL-557675
R/RES-148991
R/RES-100983
R/RL-614014
R/RL-574613
R/RL-574563
R/NN-53444
R/RL-950289
R/RES-100983
R/NN-70988
R/RL-614014
R/RL-616791
R/RL-610994
R/RL-143811
R/RL-824415
R/NN-109879
R/RES-30872
R/RL-707247
R/RL-727757
I WANT TO GET EARLIEST DATE IN SHEET2 COLUMN B FOR EVERY CELL WITH THE HELP OF SHEET 1
Thanks for the valuable information.
I have 3 columns of data.
Column 1 - Vendor
Column 2 - Items
Column 3 - Price
Data would look like this:
Vendor A Item A Price $1.00
Vendor B Item A Price $1.05
Vendor C Item A Price $1.10
Vendor D Item A Price $1.15
Vendor A Item B Price $0.50
etc
It's a straight data dump from SAP; basically in column 4 (detailed as listed above) would be the formula that I'd like to find the min price for Item A (Data is in reality scattered throughout 1000+ lines and not next to each other.
I was think a index/match/min formula to capture this but I can't figure the formula; any help would be appreciated!
I have four columns of criteria. Some rows have four cells of criteria but some have only three. My formula is: INDEX(Fb,MATCH(1,INDEX((A4=SYSTEM)*(B4=SPECIE)*(C4=SIZE)*(D4=GRADE),0),0)). This works well as long as the row containing the match has criteria in all four cells but it fails when the correct match is in a row containing a blank cell. I need a method which will treat a blank cell as a match.
Hi there, I really appriciate if you help me on vlookup on double values. I have purcasing # in one column and second column I have codes or numbers e.g., 30,20, 10 in a repetive way. I have to vlookup for anohter table that has purchasing # and codes and vlookup the 5th column that has comments. So I have to match purchasing # and code to other table and vlookup comments column.
Hopefully i am clear.
Ex:
Purchacing # 1234567 code 20
other table has the same data:
Purchasing # 9876543 code 20 comments(column)
Could you please kindly help to come up with formula.
I inserted helping formula but I would like to use different formula without inserting any column. Plus I have a big data and vlookup can do up to 250 cells.
You can concatenate the two columns on both spreadsheets directly to the left and do your match that way - I hope this comes across clear. If not, you can email me and I can send you my spreadsheet or modify yours
spreadsheet1 spreadsheet 2
'=VLOOKUP(J65&K65,$O$65:$R$67,4,FALSE) '=+S65&T65
abc 10 test abc10 abc 10 test
abcx 20 1 abcx20 abcx 20 1
abc 30 three abc30 abc 30 three
I have a registration/attendance form which contains list of people that attended the the occasion from day1 through day 5. If anyone attended or missed any day, I put "P" for present or "A" for Absent under the each day i.e Day1 Day2 Day3 Day4 Day5
P A P P P
Now, I want to find for each day, the list of people with "P". I used this formula: =INDEX(Registration!B10:B159,MATCH("P",Registration!N10:N159,0))
On the first list for Day1, the first person (Row 1) registered was present, the second person (Row 2) was absent, the third person (Row 3) was present, and so on. Upon using the above formula, I got the name of the 1st person who was present, it skipped the 2nd person since he was absent but it put the name of the 3rd person in the 2nd and 3rd row. That is:
Larry
Daniel
Daniel
I want the formula, first not to repeat names, but to skip to next as long as the person is absent. I need help.
Thank you.
Hi guys.,
I need ur help.... I made 1 time table, now i want to show the names of employees who are on leave in remarks column when i put "L" in corresponding cell...
Thank in advance
Hi.! Guys.,
I made one time table using Vlookup, conditional formatting and some other functions.... Now i want to show the names of those employees who are on leave (sick leave, anual leave etc...) in remarks cell.
Any one can help me in this tegard.???
Thanks in advance .......
how to match similar amount in different coloum different row
I required solution while choosing motor rating which is standard as per their kw rating. I am doing pump calculation & finally I am getting certain value. e.g. after pump calculation I am getting 2.3kW rating. But as per manufacturer standards I nned to select one size higher motro from following column as below. For my case the selection should be 3kW.
KW
1.1
1.5
2.2
3.0
3.7
Please suggest
HI,
=IF(AND(D54>=35,E54>=35,F54>=35,G54>=35,H54>=35,I54>=35),"PASS","FAIL")
THIS IS THE FORMULA FOR DISPLAY PASS OR FAIL STUDENTS IN THE LIST. SO I WANT TO KNOW THAT, CAN WE USE THE CELLRANGE INSTEAD ONE BY ONE.
HELP ME.
Hi,
the value that i try to match is the combination of text,-(hyphen) and number, eg. www-f-111. I noticed that they only match the www and return a result.
Anyway that my match criteria included text, hyphen and number?
Thanks in advanced.
Put "" around it. So use "www-f-111"
Hi
I am trying to use the INDEX MATCH function with multiple match criteria but wanting to also to use the Match Type 1. Here's my attempt
INDEX([Rate],MATCH(1,([From Ccy]=$F3)*([To Ccy]=$G3)*(Date]=$H3),1)
I have a table with columns [Date], [From Ccy], [To Ccy] and [Rate]
I'm trying to retrieve an FX rate for a particular [From Ccy] matching F3 and [To Ccy] matching G3, getting the [Rate] from the row with the largest [Date] less than or equal to H3.
If I put the ([Date]<=$H3 then it retrieves the first row it finds, not the largest but less than or =
Any ideas ?
A
1
2
3
4
5
A B C D Result
a 1 2 3 1
b 1 4 3 1
c 4 5 6 4
I want to check the horizontal values with the vertical values, at least one match is enough
Data range is given below. I am looking for formula while helps me
in looking up name against same value.
Data Range:
B2:B4 C2:C4
John 1
George 2
Stephen 2
Where Required:
B7:B9 C7:C9
1 ?
2 ?
2 ?
Hi!
I wanna know how to detect a label and copy all the data column from the label detected I have something like that...
sorry but I don`t have any idea to do it .-.
A B C D
1 vvcf vvcvc vcfvdf Icfgg
2 0 -0.25 0.48 -0.11
3 0 -0.25 0.48 -0.11
4 0 -0.25 0.48 -0.11
5 0 -0.25 0.48 -0.11
6 0 -0.25 0.48 -0.1
7 0 -0.25 0.48 -0.11
Great! Index Match with your explanatory examples - solved my excel issues. Thank you!
REGARDING: Look up with multiple criteria using INDEX MATCH
Your formula on 2 criteria works but to check that i understand WHY it works recreated your example in my Excel 2010 and I entered in a separate cell:
={(A2='Lookup table'!$A$2:$A$13)}
expecting it to evaluate to 1 or TRUE. However it evaluates to FALSE so although your overall formula works it shouldn't? both of the tests need to evaluate to 1 for it to find a match (zero * anything is zero or FALSE?)
Can anybody shed light on this?
I am also experiencing the same thing and using Excel 2010. Could this be an Excel 2010 issue?
Thanks a lot!
We have a pricelist that looks like this, each section is a drop down - so thickness and height has multiple selection and select no required has 8 off, 12 off, 24 off, 50 off, 150 off. I want to somehow when the customer selects each thing they want in the two cells it returns the price.
SELECT THICKNESS & HEIGHT
75 x 75 x 3 x 4M
SELECT N0. REQUIRED
8off
PRICE
No Product Price
8off 75 x 75 x 3 x 4M 147.63
12 off 75 x 75 x 3 x 4M 146.33
24 off 75 x 75 x 3 x 4M 145.03
50 off 75 x 75 x 3 x 4M 144.35
150 off 75 x 75 x 3 x 4M 143.94
Can anyone help? Thanks
Hi
How to get the year from the example "How to use INDEX MATCH to search by row and column values" ?
I would like to have the year 2015 on the header as a return value when looking for the number 321,225.
I keep getting a #N/A error.
I tried VLOOKUP and MATCH and it returned results but only after checking 64 cells.
=VLOOKUP(U4, 'Sheet1'!$A$1:$E$79, MATCH(T4,'Sheet1!A$1:E$1, 0), FALSE)
So then I went to INDEX MATCH and still returning #N/A
I have a Volume and MarketShare that need to be looked up and a dollar amount that needs to be returned.
The grid is on another sheet...
=INDEX('Sheet1'!A1:E79,MATCH(U4,'Sheet1'!$A$1:$E$79,MATCH(T4,'Sheet1'!$A$1:$E$1,0)))
What am I doing wrong?
There is an IF(AND) statement attached to the T column but like I said it was not a problem when I used VLOOKUP
Thank you in advance
Brilliant explanations, thank you.
Dear,
I am working in a transport company so i have to keep trips record up to date with the trucks numbers.so many times i have used your published formulas.
Now i need a formula to show the trucks in separate sheets "loaded & unloaded" only to put the loading and unloading dates.
if you will see, i can send you the file
Is there a way to use index-match like this vlookup fomula:
=IFERROR(VLOOKUP([Site ID],‘P:\Dropbox\Data Control Systems\[PROPERTY DETAIL SHEET MASTER.xlsm]Main_Frame_Table,COLUMN(Main_Frame_Table[CLIENT STATUS ACTIVE INACTIVE]),FALSE),"")
I would want to lookup a data from another folder.
Hi, I read the article - first off - terrific and incredibly helpful.
However, I do have a question that was not addressed.
I have a table (with headers) in J4:O15.
J5:J15 is vendor name, K4:O4 is item name. Data is K5:O15.
I have been trying multiple ways with MAX, INDEX, and MATCH to have a cell return both the Vendor and the Product based on the MAX function tried against K5:O15.
Is there a way to nest MAX with Match that I haven't understood?
TIA
Hi,
I have several tables with prices of different flights.
Different tables range from Airline1 - Adult rates, Airline 1 - Child rates, Airline 2 - Adult rates, Airline 2 - Child rates, and so on.
Now, the above doesn't seem to work as mine actually looks more like a distances table, with prices going horizontally and vertically.
So really I need to have an Index/Match formula but which knows how to choose from which table according to criteria you need.
For instance:
Airline 3 - Child rates- Mumbasa - Cairo - Result, each of these variables in a different column.
Can you help ?
Thanks in Advance.
I have a large spreadsheet that I audit monthly with customer transactions. I want to make sure a customer didn't have a second loan open before the previous loan was paid. The customer could have 5 loans on the spreadhsheet; I want to make sure that no customer loans overlap. Each customer will have their own ID number and each loan is one row of data. For example, John Doe gets a loan on 10/2/12 and it's paid off on 10/31/12, but gets another loan on 10/30/12. The second loan was done before the first loan was paid. There could be a 100,000 rows of transaction. Can you help with a formula?
Hi,
i have two cell which is created time & date in one cell & next cell i have closed time and date, in this scenario i would required your help to count only working hours which 8:00 AM to 8:00 PM excluding sundays we required number of hours has been taken to closed the case excluding non working hours & sunday, please help.
I'm having trouble get an "and" statement to work. I have the existing formula
=IF(ISNUMBER(SEARCH("-08",B562)),139,IF(ISNUMBER(SEARCH("-11-",B562)),139,IF(ISNUMBER(SEARCH("-15-",B562)),139,IF(ISNUMBER(SEARCH("-20-",B562)),139,IF(ISNUMBER(SEARCH("-30-",B562)),159)))))
But I need to see if that same source cell has a "P" included. If so then the above values would apply and if the value in the source cell is "S" then a different value would apply.
If I understand your task correctly, then please use the formula below:
=IF( OR(ISNUMBER(SEARCH("-08",B562)), ISNUMBER(SEARCH("-11-",B562)), ISNUMBER(SEARCH("-15-",B562)), ISNUMBER(SEARCH("-20-",B562)), ISNUMBER(SEARCH("-30-",B562)) ), IF( ISNUMBER(SEARCH("P",B562)), 139, IF(ISNUMBER(SEARCH("S",B562)), 999, 555)), 159)
The result will be as follows:
139 – the cell contains at least one value from this list: "-08", "-11-", "-15-", "-20-", "-30-" AND contains "P"
999 – the cell contains at least one value from this list: "-08", "-11-", "-15-", "-20-", "-30-" AND contains "S"
555 – the cell contains at least one value from this list: "-08", "-11-", "-15-", "-20-", "-30-", but does not contain "S" or "P"
159 – the cell contains nothing from this list: "-08", "-11-", "-15-", "-20-", "-30-" AND contains "P"
Hi Svetlana,
Hoping you can help me with this. I have 4 columns: Action, target date, start date, completion date. In a new table, I would like to have 5 cells in a column show the 5 text entries from the Action column that corresponding to the earliest target dates that have blank completion date cells, and have these listed in ascending date order. To the right of this 5-cell column, I would like to have the target dates corresponding to each of these actions appear. I'm not sure how to combine all of the logic elements, including having the dates recognized. I'd love some help! Thank you,
Miranda
Hello Miranda,
Please send a small sample workbook with your source data to support@ablebits.com and include the result you expect to get. Our support team will look into your task and try to help.
Hi
how can i have sorted data from large data bank in a different sheet. for example -
Date name collection $
1/01 A 100
1/01 B 50
2/01 c 200
2/01 D 20
02/01 A 40
03/01 A 100... and so on...
say this is my data sheet. now i want to make a different sheet knowing what is collection detail of A. how can i have result like following in a different sheet-
01/01 100
02/01 40
03/01 100... like this.
Please help me providing your valuable comment. Thanx in advance...
Hello Rony,
The best approach is using a pivot table. Just add the Name column to the Filters group, Date column to the Rows group, and
"collection $" column to the Values group.
You can find more information in our PivotTable tutorial.
hey, i don't know what formula in excel to be use. this is the data.
A1-CODE B1-ITEM
A2-SWOO1 B2-SWEATER
A3-JK001 B3-JACKET
A4-PN001 B4-PANTS
A5-SW002 B5-SWEATER
A6-JK002 B6-JACKET
A7-PN002 B7-PANTS
A8-SW003 B8-SWEATER
A9-JK003 B9-JACKET
A10-PN003 B10-PANTS
Wondering if you can help. I have a data set that lists dates / Sales person names and email addresses they acquired - among a slew of other data. I want to use a formula to create a list of the emails captured by an individual salesperson on a given day (of which there will be many). Example: reference a date: 1/21/15 and a salesperson: John Smith and get a list of the emails for that date. Rinse and repeat for additional sales staff. ideas?
you have your MIN and MAX examples backwards...right?
Hi,
I would like your assistance in understanding the use of INDEX MATCH.
I have two sets of data.One has NAME, ACCOUNT NUMBER, ID NUMBER and EMPLOYEE NAME.
The other has NAME, ID NUMBER and EMPLOYEE name.
I need to match the names and then I get the corresponding account numbers.
Hi, Firstly, I thank you for providing this excellent service. You are doing a great service.I need some help with this. I want to send/link cells or rows to another worksheet/book when they meet certain criteria.
For example, if the date and time attended in column D and E is later than a day or 10 hrs compared to column B and C and link those data that match criteria to another sheet.
Thank you and hope to hear from you soon.
Hi,
Please can you advise how to solve with Index & Match for 2 rows & 1 column criteria as follows
Row ---- Employee Contribution
Row ---- Employer Contribution
Column --- Employee No.
Please advise how could I bring the values from data in another sheet using Index & Match or any other alternative function.
thanks and regards,
Santosh
Svetlana,
I think I have the formula correct for the Index/Match with multiple criteria, however I can't seem to make the { } register and execute the formula.
Running Excel 2010
{=INDEX([19122014.xlsx]Sheet2!$A$1:$N$24596, MATCH(1,(C3=[19122014.xlsx]Sheet2!$B$2:$B$24596) * (E3=[19122014.xlsx]Sheet2!$F$2:$F$24596),0),12)}
Please help.
liz
Hi Liz
I am new to this and was having the same issue. I believe you don't include the {} when typing in the formula and excel actually adds this in for you.
See 1:25 on this video http://www.businessinsider.com/excel-array-formulas-microsoft-2015-1
Hope this helps!
Hi Svetlana,
Need your expert help, I am new user to complex Excel functions as have never used anything beyond sum/average/max. I am trying to use Index/Match in a scenario where based on matching account in a cell, need to sum data from 12 months column in that row. similar to example you have given for Vlookup & sum function. But I am not able to figure out how to use it.
Is this correct Sumif?
=SUMIF(Trend!$A$6:$A$16,$J18,Trend!$C6:$N6)
It is giving only single cell value of Trend!$c6 instead of sum c6:n6
or I have to use Index/Match, if so then what will syntax?
Thanks in advance
regards
Piyush
I know it is silly.
I have two sheets with data that I need to match up in the following way:
Sheet 1:
Col A = Company name
Col B = Company address
Col C = Rent
Sheet 2:
Col A = Company name
Col B = Company address
The hard part is that on sheet 1 the list has different company names for the same address in multiple rows. Example:
ABC Inc, 123 Main St., $500
XYZ Inc, 456 Main Ave, $600
GHI Corp, 123 Main St, $550
I need to match the most recent (highest row number) or BOTH the company name and address with those on Sheet 2 and return the RENT from Sheet 1.
I have a feeling that this is going to require diving into VBA.
I have tried using INDEX and MATCH functions with helper columns but I can't get it to match BOTH cells.
Thanks
Hi Svetlana,
Great post.
Using your dateset for the 'How to use INDEX MATCH to search by row and column values example', how could you answer the question:
"By what year was the population of USA >= 300,000,000?" The answer should be 2015.
Essentially I have a very similar data set and I want to output a column title value, with the row title and a specific value as input.
Thanks!
Hugh
Hi there,
how could I do multiply array match? Thanks very much!
25 is the value to match with the data set below:
a b c d e f g h
60 60 60 60 60 60 60 60
120 120 120 120 120 120 120 120
200 200 200 200 200 200 200 200
80 110 110 110 110 110 110 110
25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25
22 22 22 22 22 22 22 22
70 70 70 70 70 70 70 70
120 120 120 120 120 120 120 120
50 80 80 80 80 80 80 80
10 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15
Regards,
Jana
Hi Svetlana,
I am using the index/match function successfully, however I have a set of data that has the lookup value for the match function listed multiple times in the data set. Is there a way to choose the lookup value based on the value of the corresponding indexed data value. For example:
A B
1 Joe
2 Bob
3 Joe
4 Sally
5 Joe
How would I get the function to return the value 5 from column A rather than 1?
Thanks,
Chris