This tutorial shows how to use INDEX and MATCH in Excel and how it is better than VLOOKUP.
In a couple of recent articles, we made a good effort to explain the basics of VLOOKUP function to beginners and provide more complex VLOOKUP formula examples to power users. And now, I will try if not to talk you out of using VLOOKUP, then at least show you an alternative way to do a vertical lookup in Excel.
"What do I need that for?" you may wonder. Because VLOOKUP has numerous limitations that can prevent you from getting the desired result in many situations. On the other hand, the INDEX MATCH combination is more flexible and has many awesome features that make it superior to VLOOKUP in many respects.
Excel INDEX and MATCH functions - the basics
Since the aim of this tutorial is to demonstrate an alternative way to do a vlookup in Excel by using a combination of INDEX and MATCH functions, we won't dwell much on their syntax and uses. We will cover only the minimum necessary for understanding the general idea and then take an in-depth look at formula examples that reveal all the advantages of using INDEX MATCH instead of VLOOKUP.
INDEX function - syntax and usage
The Excel INDEX function returns a value in an array based on the row and column numbers you specify. The syntax of the INDEX function is straightforward:
Here is a very simple explanation of each parameter:
- array - a range of cells that you want to return a value from.
- row_num - the row number in array from which you want to return a value. If omitted, the column_num is required.
- column_num - the column number in array from which you want to return a value. If omitted, row_num is required.
For more information, please see Excel INDEX function.
And here is an example of the INDEX formula in its simplest form:
=INDEX(A1:C10,2,3)
The formula searches in cells A1 through C10 and returns a value of the cell in the 2nd row and the 3rd column, i.e. cell C2.
Very easy, right? However, when working with real data you would hardly ever know which row and column you want, that's where the MATCH function comes in handy.
MATCH function - syntax and usage
The Excel MATCH function searches for a lookup value in a range of cells and returns the relative position of that value in the range.
The syntax of the MATCH function is as follows:
- lookup_value - the number or text value you are looking for.
- lookup_array - a range of cells being searched.
- match_type - specifies whether to return an exact match or the nearest match:
- 1 or omitted (default) - approximate match (next smaller).
- 0 - exact match. In the INDEX / MATCH combination, you almost always need an exact match, so you set the third argument of your MATCH function to 0.
- -1 - approximate match (next larger).
For example, if the range B1:B3 contains the values "New-York", "Paris", "London", the below formula returns the number 3, because "London" is the third entry in the range:
=MATCH("London",B1:B3,0)
For more information, please see Excel MATCH function.
At first sight, the usefulness of the MATCH function may seem questionable. Who cares about the position of a value in a range? What we do want to know is the value itself.
Let me remind you that the relative position of the lookup value (i.e. row and column numbers) is exactly what you need to supply to the row_num and column_num arguments of the INDEX function. As you remember, Excel INDEX can find the value at the juncture of a given row and column, but it cannot determine which exactly row and column you want.
How to use INDEX MATCH function in Excel
Now that you know the basics, I believe it has already started making sense how MATCH and INDEX work together. In a nutshell, INDEX finds the lookup value by column and row numbers, and MATCH provides those numbers. That's it!
For vertical lookup, you use the MATCH function only to determine the row number and supply the column range directly to INDEX:
Still having difficulties to figure that out? It might be easier to understand from an example. Suppose you have a list of national capitals and their population:
To find the population of a certain capital, say the capital of Japan, use the following INDEX MATCH formula:
=INDEX(C2:C10, MATCH("Japan", A2:A10, 0))
Now, let's analyze what each component of this formula actually does:
- The MATCH function searches for the lookup value "Japan" in the range A2:A10, and returns the number 3, because "Japan" is third in the lookup array.
- The row number goes directly to the row_num argument of INDEX instructing it to return a value from that row.
So, the above formula turns into a simple INDEX(C2:C,3) that says to search in cells C2 through C10 and pull the value from the 3rd cell in that range, i.e. C4 because we start counting from the second row.
Don't want to hardcode the city in the formula? Input it in some cell, say F1, supply the cell reference to MATCH, and you will get a dynamic lookup formula:
=INDEX(C2:C10, MATCH(F1,A2:A10,0))
Important note! The number of rows in the array argument of INDEX should match the number of rows in the lookup_array argument of MATCH, otherwise the formula will produce an incorrect result.
Wait, wait… why don't we simply use the following Vlookup formula? What's the point in wasting time trying to figure out the arcane twists of Excel MATCH INDEX?
=VLOOKUP(F1, A2:C10, 3, FALSE)
In this case, no point at all :) This simple example is for demonstration purposes only, so that you get a feel of how the INDEX and MATCH functions work together. Other examples that follow below will show you the real power of this combination that easily copes with many complex scenarios when VLOOKUP stumbles.
Tips:
- In Excel 365 and Excel 2021, you can use a more modern INDEX XMATCH formula.
- For Google Sheets, see formula examples with INDEX MATCH in this article.
INDEX MATCH vs. VLOOKUP
When deciding which function to use for vertical lookups, most Excel gurus agree that INDEX MATCH is far better than VLOOKUP. However, many people still stay with VLOOKUP, firstly, because it's simpler and, secondly, because they do not fully understand all benefits of using the INDEX MATCH formula in Excel. Without such understanding no one is willing to invest their time to learn a more complex syntax.
Below, I will point out the key advantages of MATCH INDEX over VLOOKUP, and you decide whether it's a worthy addition to your Excel arsenal.
4 main reasons to use INDEX MATCH instead of VLOOKUP
- Right to left lookup. As any educated user knows, VLOOKUP cannot look to its left, meaning your lookup value should always reside in the leftmost column of the table. INDEX MATCH can do left lookup with ease! The following example shows it in action: How to Vlookup a value to the left in Excel.
- Insert or delete columns safely. VLOOKUP formulas get broken or delivers incorrect results when a new column is deleted from or added to a lookup table because VLOOKUP's syntax requires specifying the index number of the column you want to pull the data from. Naturally, when you add or delete columns, the index number changes.
With INDEX MATCH, you specify the return column range, not an index number. As the result, you are free to insert and remove as many columns as you want without worrying about updating every associated formula.
- No limit for a lookup value's size. When using the VLOOKUP function, the total length of your lookup criteria cannot exceed 255 characters, otherwise you will end up having the #VALUE! error. So, if your dataset contains long strings, INDEX MATCH is the only working solution.
- Higher processing speed. If your tables are relatively small, there will hardly be any significant difference in Excel performance. But if your worksheets contain hundreds or thousands of rows, and consequently hundreds or thousands of formulas, MATCH INDEX will work much faster than VLOOKUP because Excel will have to process only the lookup and return columns rather than the entire table array.
VLOOKUP's impact on Excel's performance may be especially noticeable if your workbook contains complex array formulas like VLOOKUP and SUM. The point is that checking each value in the array requires a separate call of the VLOOKUP function. So, the more values your array contains and the more array formulas you have in a workbook, the slower Excel performs.
To discover the nuanced differences between INDEX MATCH and XLOOKUP, explore the in-depth analysis in this guide: Excel XLOOKUP vs INDEX MATCH.
Excel INDEX MATCH - formula examples
Knowing the reasons to learn the MATCH INDEX function, let's get to the most interesting part and see how you can apply the theoretical knowledge in practice.
INDEX MATCH formula to look up from right to left
As already mentioned, VLOOKUP cannot look at its left. So, unless your lookup values are is the leftmost column, there's no chance that a Vlookup formula will bring you the result you want. The INDEX MATCH function in Excel is more versatile and does not really care where the lookup and return columns are located.
For this example, we will add the Rank column to the left of our sample table and try to figure out how the Russian capital, Moscow, ranks in terms of population.
With the lookup value in G1, use the following formula to search in C2:C10 and return a corresponding value from A2:A10:
=INDEX(A2:A10,MATCH(G1,C2:C10,0))
Tip. If you plan to use your INDEX MATCH formula for more than one cell, be sure to lock both ranges with absolute cell references (like $A$2:$A$10 and $C$2:4C$10) so they won't get distorted when copying the formula.
INDEX MATCH MATCH to search in rows and columns
In the above examples, we used INDEX MATCH as the replacement for classic VLOOKUP to return a value from a predefined one-column range. But what if you need to look up in multiple rows and columns? In other words, what if you want to perform the so-called matrix or two-way lookup?
This may sound tricky, but the formula is very similar to the basic Excel INDEX MATCH function, with just one difference. Guess what?
Simply, use two MATCH functions – one to get a row number and the other to get a column number. And I congratulate those of you who have guessed right :)
And now, please take a look at the below table and let's build an INDEX MATCH MATCH formula to find the population (in millions) in a given country for a given year.
With the target country in G1 (vlookup value) and the target year in G2 (hlookup value), the formula takes this shape:
=INDEX(B2:D11, MATCH(G1,A2:A11,0), MATCH(G2,B1:D1,0))
How this formula works
Whenever you need to understand a complex Excel formula, break it down into smaller parts and see what each individual function does:
MATCH(G1,A2:A11,0)
– searches through A2:A11 for the value in cell G1 ("China") and returns its position, which is 2.
MATCH(G2,B1:D1,0))
– searches through B1:D1 to get the position of the value in cell G2 ("2015"), which is 3.
The above row and column numbers go to the corresponding arguments of the INDEX function:
INDEX(B2:D11, 2, 3)
As the result, you get a value at the intersection of the 2nd row and 3rd column in the range B2:D11, which is the value in cell D3. Easy? Yep!
Excel INDEX MATCH to look up multiple criteria
If you had a chance to read our Excel VLOOKUP tutorial, you have probably already tested a formula to Vlookup with multiple criteria. However, a significant limitation of that approach is the necessity to add a helper column. The good news is that Excel's INDEX MATCH function can look up with two or more criteria too, without modifying or restructuring your source data!
Here's the generic INDEX MATCH formula with multiple criteria:
Note. This is an array formula that must be completed with the Ctrl + Shift + Enter shortcut.
In the sample table below, supposing you want to find the amount based on 2 criteria, Customer and Product.
The following INDEX MATCH formula works a treat:
=INDEX(C2:C10, MATCH(1, (F1=A2:A10) * (F2=B2:B10), 0))
Where C2:C10 is the range to return a value from, F1 is criteria1, A2:A10 is the range to compare against criteria1, F2 is criteria 2, and B2:B10 is the range to compare against criteria2.
Remember to enter the formula correctly by pressing Ctrl + Shift + Enter, and Excel will automatically enclose it curly brackets as shown in the screenshot:
If you'd rather not use array formulas in your worksheets, add one more INDEX function to the formula and complete it with a usual Enter hit:
How these formulas work
The formulas use the same approach as the basic INDEX MATCH function that looks through a single column. To evaluate multiple criteria, you create two or more arrays of TRUE and FALSE values that represent matches and non-matches for each individual criterion, and then multiply the corresponding elements of these arrays. The multiplication operation converts TRUE and FALSE into 1 and 0, respectively, and produces an array where 1's correspond to rows that match all the criteria. The MATCH function with a lookup value of 1 finds the first "1" in the array and passes its position to INDEX, which returns a value in this row from the specified column.
The non-array formula relies on the ability of the INDEX function to handle arrays natively. The second INDEX is configured with 0 row_num so that it will pass the entire column array to MATCH.
That is a high-level explanation of the formula's logic. For full details, please see Excel INDEX MATCH with multiple criteria.
Excel INDEX MATCH with AVERAGE, MAX, MIN
Microsoft Excel has special functions to find a minimum, maximum and average value in a range. But what if you need to get a value from another cell that is associated with those values? In this case, use the MAX, MIN or AVERAGE function together with INDEX MATCH.
INDEX MATCH with MAX
To find the largest value in column D and return a value from column C in the same row, use this formula:
=INDEX(C2:C10, MATCH(MAX(D2:D10), D2:D10, 0))
INDEX MATCH with MIN
To locate the smallest value in column D and pull an associated value from column C, use this one:
=INDEX(C2:C10, MATCH(MIN(D2:D10), D2:D10, 0))
INDEX MATCH with AVERAGE
To work out the value closest to the average in D2:D10 and get a corresponding value from column C, this is the formula to use:
=INDEX(C2:C10, MATCH(AVERAGE(D2:D10), D2:D10, -1 ))
Depending on how your data is organized, supply either 1 or -1 to the third argument (match_type) of the MATCH function:
- If your lookup column (column D in our case) is sorted ascending, put 1. The formula will calculate the largest value that is less than or equal to the average value.
- If your lookup column is sorted descending, enter -1. The formula will compute the smallest value that is greater than or equal to the average value.
- If your lookup array contains a value exactly equal to the average, you can enter 0 for exact match. No sorting is required.
In our example, the populations in column D are sorted in descending order, so we use -1 for match type. As the result, we get "Tokyo" since its population (13,189,000) is the closest match that is greater than average (12,269,006).
You may be curious to know that VLOOKUP can perform such calculations too, but as an array formula: VLOOKUP with AVERAGE, MAX, MIN.
Using INDEX MATCH with IFNA / IFERROR
As you have probably noticed, if an INDEX MATCH formula in Excel cannot find a lookup value, it produces an #N/A error. If you wish to replace the standard error notation with something more meaningful, wrap your INDEX MATCH formula in the IFNA function. For example:
=IFNA(INDEX(C2:C10, MATCH(F1,A2:A10,0)), "No match is found")
And now, if someone inputs a lookup table that does not exist in the lookup range, the formula will explicitly inform the user that no match is found:
If you'd like to catch all errors, not only #N/A, use the IFERROR function instead of IFNA:
=IFERROR(INDEX(C2:C10, MATCH(F1,A2:A10,0)), "Oops, something went wrong!")
Please keep in mind that in many situations it might be unwise to disguise all errors because they alert you about possible faults in your formula.
That's how to use INDEX and MATCH in Excel. I hope our formula examples will prove helpful for you and look forward to seeing you on our blog next week!
Practice workbook for download
Excel INDEX MATCH examples (.xlsx file)
614 comments
Dear Sir,
I am trying to find value and display in answer columns but we are not success. please guide me.
see the table.
Sir I hope you reply as early as possible.
Inst_Code course_code Vacant Inst_Code Course_Code Vacant Answer
4 16 1 4 16 1 1
4 16 1 4 16 1 1
4 16 3 4 17 3 #REF!
4 16 2 4 17 2 #REF!
4 17 2 4 23 2 #REF!
4 17 1 4 29 1 #REF!
4 22 1 4 30 1 #N/A
4 22 1 4 22 5 #REF!
4 23 3 4 17 6 #REF!
4 28 2 4 17 2 #REF!
4 28 2 4 30 3 #N/A
4 29 1 4 29 4 #REF!
{=INDEX($A$2:$C$2,MATCH(1,(E2=$A$2:$A$13)*(F2=$B$2:$B$13),0),3)}
Sir, I request you please reply as early as possible.
Thanking you,
Binoy
Hi Svetlana,
How can I use the INDEX and MATCH with a four dimensional look up (3 Vertical and 1 horizontal)? I tried extending the two dimensional example and it did not work.
For Eg:
January February March April
Leather Black Big Bag 100 200 300 400
Leather Red Small Bag 200 300 400 500
Leather Green Big Bag 300 400 500 600
Leather Yellow Small Bag 400 500 600 700
Cotton Black Big Bag 500 600 700 800
Cotton Red Small Bag 600 700 800 900
Cotton Green Big Bag 700 800 900 1000
Cotton Yellow Small Bag 800 900 1000 1100
i want to write a formula to look up the value for the following :
Cotton Green Big Bag January
Cotton Red Small Bag March
Leather Yellow Small Bag February
Request your help please
In the table under #calculations-index-match, you refer to a function that gets the row number of the maximum value as one that gets the row number of the minimum value and vice versa. Also, near the top of the page, you refer to "MATCH(lookup_value, lookup_array, [match_type])" as the syntax of the INDEX function.
I did not realize there were so many "bugs" in this post. I should probably find a good proofreader... Thanks again for pointing out those errors for me.
In the first paragraph below #index-match-basics, where is says "a combination of INDEX and VLOOKUP functions", I believe you meant "a combination of INDEX and MATCH functions".
Hi Hank,
Spot on :) Thanks very much, fixed!
I am trying to create a spreadsheet where it will put a value from a table depending on the code entered and name of insurance provider. Would this be the best tool to use?
Hello,
I am trying write a function to count the number of unique values in one column that fall in a category in another column.
Here is a simplified example of my data:
Order Qty Group
1 1 1
2 2 1
3 1 1
4 4 1
5 5 2
6 8 2
7 2 2
8 4 2
9 6 2
I want to know how many different/unique order quantities there are within group 1, group 2, etc but without designating the cell range, just the particular value (1 or 2 in this case).
Thanks so much!
Q column A contains a series of data from 1 up to 100 numbers, while column B have data 1 upto 150 numbers but two times.compare A and B column then hilight matching ones. Thanks 4 ur comments
Example:
A B A+B Up-to-date
1.00 2.00 3.00 3.00
How can it be possible in the fourth cell to remain the value 3 even after editing A & B Cell Value as well as yield previous sum-total + Current sum-total effect in the same fourth cell.
Say, if I delete the value 1 & 2 from A & B; A+B can be 0 but Up-to-date value will show 3 and again if I put 2 in A & 3 in B; A+B = 5 but Up-to-date value have to be 8
A B A+B Up-to-date
2.00 3.00 5.00 8.00
No manual operation except putting value in A & B Cell rest are linked by formula. Please Help..
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.