INDEX & MATCH in Excel - better alternative to VLOOKUP

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 VLOOKUP or INDEX / MATCH - which is better?

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:

INDEX(array, row_num, [column_num])

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:

MATCH(lookup_value, lookup_array, [match_type])
  • 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:

INDEX(column to return a value from, MATCH(lookup value, column to look up against, 0))

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:
Source data for INDEX MATCH formula

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))
Excel INDEX MATCH formula

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:

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

  1. 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.
  2. 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.

  3. 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.
  4. 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))
Look up values to left using INDEX MATCH

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 :)

INDEX(array, MATCH(vlookup value, column to look up against, 0), MATCH(hlookup value, row to look up against, 0))

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))
INDEX MATCH MATCH formula for two-way lookup in Excel

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:

{=INDEX(return_range, MATCH(1, (criteria1=range1) * (criteria2=range2), 0))}

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:
The INDEX MATCH formula to look up multiple criteria

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:
A non-array INDEX MATCH formula with multiple criteria

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).
Using INDEX MATCH with AVERAGE, MAX, MIN

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:
Using INDEX / MATCH with IFNA function to trap N/A errors

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)

599 comments

  1. Please help. I want that the result would be like this:

    RESULT: Cell A4 is Letters with "No". Cell A5 is: B,C,F,K

    DATA:
    Cell A1 is A, B1 is B, C1 is C,...up to Q1 is Q. Cell A2 is Yes, B2 is No, C2 is No, D2 is Yes, E2 is Yes, F2 is Yes, G2 is Yes, H2 is Yes, I2 is Yes, J2 is Yes, K2 is No,...up to Q2 is No.

  2. Dear Svetlana,
    My Data Table Is Like :

    From Per To Per Marks

    -40.01 -999 0
    -30.01 -40 20
    -20.01 -30 30
    -15.01 -20 40
    -10.01 -15 55
    -8.01 -10 70
    -5.01 -8 90
    0 -5 100
    0.01 5 100
    5.01 8 90
    8.01 10 80
    10.01 15 65
    15.01 20 55
    20.01 30 45
    30.01 40 35
    40.01 999 15

    I have Value Like :

    Per Marks
    -20.83 ?
    10.53 ?
    13.64 ?
    -3.35 ?
    1.63 ?
    32.14 ?
    8.33 ?
    6.67 ?
    2.08 ?
    2.00 ?
    8.33 ?
    20.19 ?
    -6.45 ?
    3.27 ?
    -2.17 ?
    0.00 ?
    28.35 ?
    0.00 ?

    I want Answer On "?"
    I want to look "Per" in upside table.
    Plz Give me formula for this

  3. Dear Svetlana,

    I wonder if you might help with a problem…I’m not sure what I’m trying to do is possible.

    I have a ‘Lookup’ worksheet with a simple three column setup
    A B C
    WARD TRADEAS CPAddress
    1 ERNEHL Shop 1 Address 1
    2 PLAINS Restaurant 2 Address 2
    3 BSTALB School B Address 3
    4 GEDLNG Shop 2 Address 4
    5 CARLTN School B Address 5
    6 BSTALB Shop 3 Address 6
    7 NETHFD Shop 4 Address 7
    8 NETHFD Restaurant 3 Address 8
    9 NETHFD Shop 5 Address 9
    10 PHOENX Restaurant 4 Address 10

    I then have officers that cover particular ward(s)…so:-

    Officer A covers PHOENX, PLAINS and ERNEHL
    Officer B covers NETHFD, BSTALB, GEDLNG and CARLTN

    What I was trying to do was to search the ‘Lookup’ worksheet for all establishments assigned to Officer A (i.e. those with a WARD code of PHOENX, PLAINS and ERNEHL) and then return the resulting list of establishments and addresses (Column B and C) into a second worksheet (so giving a list of establishments to be inspected)…and them similarly repeat this for Officer B.

    Any pointers as to how I would achieve this would be really gratefully received

    Many thanks

    Brendan

  4. I appreciate it if somebody help me:
    I have two different excel files X and Y. In file X there are column "Date" with format of ("e.g January 1,2012") and column "Time" with format of (" e.g 1 a.m to 1:59 a.m") . in file "Y" I have three columns: "Date"(same format of file X) ,"Time" (format of 1 a.m that means 1 a.m to 1:59 a.m) and column "Amount". I want to first compare column "Date" in two files and see if they are matched then compare their appropriate "time" and see if their time are matched, then bring the appropriate "Amount" from file "y" to file X in a new column. note: time format in two files are different.

  5. Very useful information.. Thank you for sharing

  6. Hi, got a simple question. In your example of "Look up with multiple criteria using INDEX MATCH," the customer/product/qty example, how would you write a INDEX MATCH formula to average the Biscuits quantities?

    • Hi Jason,

      I believe it's easier to do with the AVERAGEIF formula like this:

      =AVERAGEIF(B2:B10, "biscuits", C2:C10)

      Where B2:B10 are products and C2:C10 are quantities.

  7. hi !

    i need tot know How to VLOOKUP with Multiple Criteria in different sheets if A1 = A:A & B2 = B:E,3

    Tnx!

  8. THANXXXXXXXXXXX.......FOR INDEX FORMULA

  9. Hello! I need to visually split "Pyramid" chart. I created one for one fiscal year but I need to have 2 fiscal years reflected on one pyramid with a vertical line in the middle. Can anybody help/show hot to do this?
    where I can send "snap-it" attachment?
    Thank you! :-)

  10. Instaded of using such cretical formula we can get these results just using Pivote table function " so could I know what's advantage of using Index & Match function over Pivote table"

  11. I'm having difficulty getting any of this to work for exactly what I'm wanting to do. I'm working with 2 spreadsheets: "2001 Base Data" (BD) and "Knowledge Occupations" (KO). I'm trying to pull data from BD into KO. In KO I have the Name in column D. In each successive column there is an OCC code (xx-xxxx). I'm trying to pull employment by matching the Name in column D and an OCC code with the name & OCC code in BD. BD has the name in column B and the OCC code in column C. I want KO to return the value from column F in spreadsheet BD.

    Any guidance that can be provided would be immensely appreciated.

    Thank you!

  12. Dear mam/sir i reading in vlookup formula but i did not clear so kindly that by example

  13. Hi there hope you could help me i have a problem to use index match formula i before i was using vlookup but each time i have pasted new report the formula stop working

    i have a tab with vendor list
    column A Document number
    Column B Vendor number

    and tab with vat input
    column A
    document number

    i need formula to go to vendor list match the document number with the document number from VAT list and return the vendor number from the vendor list which is next to the document number in this list.

    My formula = INDEX( VENDORLIST $A:$B, Match(VAT List $A2,VAT List A:A,0),2))

    this formula does not return the right vendor number.

    Can you please advise ?

    Thanks,
    Aleks

  14. Is there a way for me to copy the array formula to multiple cells without press ctrl + shift + enter at each cell? when i press shift+F9 an error appear "Excel run out of resource while attempting to calculate one or more formulas. as a result, these formulas cannot be evaluated".

  15. I am trying to set a spreadsheet so that if it looks up a table. There are three columns; size of timber, rate to charge and the rate charged in £.
    I want to set it so that if the size and rate match on my spreadsheet details I have inputted then it picks up the charge rate from the table and inputs it so I know what to charge based on the size and rate chosen.
    Help if possible!

  16. what are the scenario where we do use index and match?
    and what is If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE. In Match function

  17. Hi,

    A big thanks to anyone who can help with this.

    Column A
    14P3WSKK1637I35DM
    13A4P5FL7243G95126
    13A4CL1E5051I36B28
    13A4CL1E5051I09Q30
    13A4Y9GE50C733N32
    13A4DLES1206I90132
    14P4CWN5V3W5G24PS
    14P4CWN5V5Q5G24PSS

    Coumn B
    S
    SS
    28
    30
    32
    M

    Comumn C
    Small
    Extra Small
    Size 28
    Suze 30
    Suze 32
    Medium

    I have to search for the text from column B in Column A and return the corresponding value from Column C.

    Basically the last character or combination of the last two characters make up the size of the clothing.

    Thanks a million.

    Umar

  18. Svetlana, I enjoy your formulas explanations: very visual, very concise.
    I have a long formula I am using (was created my may manager). Formula works, but I'd like to find ways to make it shorter and more"elegant". Since the formula takes almost a page in Word, I'd like to pay you for a working solution. Must be for Excel 2010 & 2013. I use both for internal reasons on 2 computers.
    Thank you!

    • Hi Olga,

      I am glad to hear you've found my articles helpful. Please send us a sample workbook with your original formula to support@ablebits.com and we will see if we can help. (To make sure your message immediately gets in the right hands, please refer to this comment or write something like "Att: Svetlana" in the subject).

  19. 4 4.25 4.5 4.75 5
    1.10 1.11 1.13 1.14 1.15
    1.08 1.09 1.10 1.11 1.12
    1.06 1.07 1.08 1.08 1.09
    1.04 1.06
    1.02 1.03
    1.00 1.01
    -22 212 233.2 235.9 238.5 241.2 243.8
    -21 206 226.6 229.2 231.8 234.3 236.9
    -20 200 220.0 222.5 225.0 227.5 230.0
    -19 194 213.4 215.8 218.3 220.7 223.1
    -18 188 206.8 209.2 211.5 213.9 216.2
    -17 182 200.2 202.5 204.8 207.0 209.3
    -16 176 193.6 195.8 198.0 200.2 202.4
    -15 170 187.0 189.1 191.3 193.4 195.5
    -14 164 180.4 182.5 184.5 186.6 188.6

    Hi,please see above which is driving me crazy. I have a number I want to match with row 1 (eg 4) and I have a value corresponding to the main table (eg 192.2) and I want it to give me the left hand column value nearest to (192.2) which in this instance would be -16. Is this possible please?

    • Sorry, the row 1 item (4) is in cell C1 and the nearest number to 192.2 is 193.6 in cell c14 and I would like it to return -16 from cell A14.

      Hope that makes more sense.

  20. I am attempting to do a vlookup or an index/match function in excel to return a name of an organization. I want excel to look at a value in cell G24 and if it is # look in H24 and return a value from a separate tab or return a value from another tab if it is not a # in G24. In other words I am doing Vlookup,(G24,'Organization data,!A2:C229,2,0) and vlookup(H24,'fp'!A2:c926,1,0). Is it possible to combine that function to return a solution?

  21. I use sum(if(...) array formula to get the results from data for multiple conditions. Can Index(Search) option be used to replace this and get the count and sum from the table based on more than 2 criteria. fox ex. from a data of students, we want sum of boys having age <=10 and passed with more than 80%.

  22. Hi,

    I need help, let me know if you can fix my problem.
    Say I have Master Data:
    Col A Col B
    Book 123
    Book 60
    Pencil 50
    Pencil 100

    Than I expect summary table:
    Col A Col B
    Book 123
    Pencil 100
    The maximum of same index in Col A

    How can we make it in excel?

  23. Hi,

    I need to add prefix with as no of zero as required to the amount field till the lenth becomes 11 digit.

    For example, if amount field is 1000, then it prefix with 7 zeros as '00000001000' and if amount field is 10000, then it prefix with 6 zeros.

    • Hi Shankar,

      Kindly right click on cells and select format cells. Now select format special and manually type 11 zeros (00000000000) in type box. Hope this will solve your requirement.

  24. thanks for clear and simple explanation. it s very usefull

  25. Hello Svetlana,

    Hope you can help me on this project.
    I did manage to get it resolved by using vlookup however, I need to know if there's another way to do it.

    Here's a dummy example:

    1. Detail Tab
    Status Account Amount
    No Budget Apple $100
    Budget Pear $200
    No Budget Apple $200
    No Budget Orange $300
    Budget Banana $100
    No Budget Orange $500
    No Budget Apple $200

    2. Summary Tab
    Account Amount
    Apple $500
    Orange $800

    So, all I need is to bring the results automatically of the No Budget account from the Detail Tab into the Summary Tab which in this example are the Apple and Orange and their total as well to show as one.

    Is there another formula I can use?

    Thanks very much in advance.

    Henry

  26. Svetlana,

    I was trying to adapt your tutorial to my needs with no success. I have a workbook with hundreds of worksheets. Each worksheet represents a computer. Every worksheet is identically laid out, with 10 columns but varying rows, and every column has similar information. I have a formula that looks like this: =COUNTIFS(C:C,"high",J:J,"Open") and it counts the cells that have a High severity rating AND a check state of Open. I am trying to figure out how to take those two criteria from a row and put the value of the cell in the same row of column D into a cell. Column D is the RuleID of a vulnerability. So it would look like this: IF the value in column C is "High", and the value of column J is "Open", then place the value of column D ("SV-32245r1_rule") in this cell. Can you help me?

  27. Team,

    Am stack trying to use the index function but return the results as a horizontal array instead of vertical? Any idea how I can achieve this?

    Elvis

  28. Hi Svetlana,

    Thanks for such awesome explanation on excel functions.

  29. I am trying to solve a problem where I have two rows. Row 1 has Product Names eg PD1, PD2, PD3, PD4. Row 2 has corresponding quantity. When products are ordered by customers, I am trying to summarise for each customer what products they have ordered such as PD1, PD4. I have a formula that works but it is too long and makes it difficult to add another product.
    =IF(ISBLANK(L6),"",$L$3)&IF(ISBLANK(M6),"",", "&$M$3)&IF(ISBLANK(N6),"",", "&$N$3)&IF(ISBLANK(O6),"",", "&$O$3

    Is there some way of seeing that the cell is not blank and returning the corresponding Product Name. Thanks

  30. Hello,

    Thanks for all the info and help! When I added the "IFERROR" to the beginning of my formula (INDEX AND MATCH formula and it was working perfectly prior to adding the iferror feature)it removed the $ format from the cell. I cannot seem to find a way to format the cell to show it as currency.
    Can you please help.

    Bill

  31. Hi,
    I need help with a a report.
    I currently have a tab for every month of the year. I am collecting the employee's names which change every month and I have a column that collections notes based on their monthly performance.
    I also have a tab which i currently have set it up to collect the data from each monthly tab to show all notes in one place.
    My issue is that when I update the name list, the notes collected in the freeflow area, do not move with the employee. This is causing more manual work on my part to re-enter the comments every month.
    I would like for the performance comments to follow the agent's name no matter where they land in column 1.
    Can you assist?

  32. Hi Svetlana,

    Excellent article! I stumbled across it recently in my search to solve a dynamic lists issue I've been battling for almost a week now. My scenario:
    I have several sheets in my workbook:

    Sheet 1 contains a list of locations
    Col1 Col2
    LocationName LocationID
    Syndey 1
    Melbourne 2
    Perth 3

    Sheet 2 contains a list of courses
    CourseName CourseID
    Course A 1
    Course B 2
    Course C 3

    Sheet 3 contains a list the sessions for all of the course:
    SessionName SessionID
    Session 1 1
    Session 2 2
    Session 3 3

    Sheet 4 contains a list of date dates each course is run in each location:
    Col1 Col2 Col3 Col4
    ScheduleID Ref to LocationID Ref CourseID CourseDate
    1 1 1 14/01/2014
    2 1 1 18/03/2014
    3 1 2 23/10/2014

    Sheet 5 contains a list of the dates for each session for each course date:
    Col1 Col2 Col3
    Ref to ScheduleID Ref to SessionID SessionDate
    1 1 14/01/2014
    1 2 15/01/2014
    1 1 18/03/2014
    1 2 19/03/2014
    2 1 23/10/2014
    2 2 24/10/2014

    Here's what I want to achieve:
    Col1 Col2 Col3 Col4 Col5
    Location Course CourseDate Session SessionDate

    1. User selects Location from dropdown list(Sourced from Sheet1).
    2. User selects Course from dropdown list(Sourced from Sheet2).
    3. CourseDate dropdown list filters to only show matches for the selected Location and Course(Sourced from Sheet4). User selects CourseDate.
    4. Sessions dropdown list filter to only show SessionDates for the matching ScheduleID and SessionID (Sourced from Sheet5).
    5. SessionDate to auto poplulate with the matching record from Sheet 5.

    My data is set up as per the examples above as it's near impossible to create a separate list for each combination.

    Any help on who I can achieve this in Excel would be great.

  33. Is there a way to do a 2-way Index Match Max? I've only seen things posted to find Max on a standard Index Max, but not on an Index Match Match.

  34. DHAVAL KAMLESH RAMESH KAPIL
    500 1500 1950 1950 1950 RAMESH AND RAMESH
    25 2800 85 100 2800 KAMLESH

    =+INDEX($B$2:$E$2,MATCH(MAX(B4:E4),B4:E4,0))

    IF HAVE SAME AMOUNT 2 PARSON THAN WHICH FROMULA USE

    PLZ HELP

  35. A fantastic intro to the amazing world of 'match and index'.
    Thanks you.
    Chuck

  36. I want use 15 min time interval values (like 15:00, 15:15, 15:30, 15:45 ...........) from A1 to A10 in a excel sheet and if the value is >0 (like 15) in B1 to B07 (actual range is B1:B10) so now I want to print cell values in A (ranges A1 to A10) based on B (ranges from B1:B10) in line chart graph. Please Help me.

  37. Hey Guys,

    Does INDEX and MATCH excel formulas help us to compare two columns and return me the data that is not there in the former coloumn.
    For ex :
    Template 1 has a PL column with row data GLCA:GLUS:GLOBAL:WCH2:WAS2:CHINA:AUST:GLEEMEA:GLUS
    Template 2 has a PL column with row data GLCA:GLUS:WCH2:WAS2:CHINA:GLEEMEA

    I want the data that is missing in template 2 but available in template 1.

    Let me know what formula is the best...

  38. HEELO SIR,
    I HAVE A ROW NAMED NET PRICE.
    ON RIGHT HAND SIDE I HAVE THREE TO FOUR RECOMENDED PRICE ADJACENT TO COMMISSION.
    NOW THE CONDITION IS IF MY NET PRICE MATCHES WITH RECOMENDED PRICE WE WILL GET COMMISSION AS PER THAT PRICE.SOMETIME MY 2 TO 3 RECOMENDED PRICE MATCHES WITH NET PRICE AND I WILL RECIEVE THE MAXIMUM COMMISSION FROM THAT RECOMENDED PRICE.

    I AM MENTIONING THE FORMAT OF EXCEL BELOW
    NET PRICE RECO.PRICE COMM RECO.PRICE COMM RECO.PRICE PROMO
    145 145 50 145 55 140 65

    NOW PLEASE GIVE ME THE FORMULA WHERE COMMISSION OF 55rs IS TO BE DISPLAYED AS THERE ARE 4 TO 5 LAKH ROWS SO IT IS NOT POSSIBLE TO CALCULATE TOTAL COMMISSION MANUALY.
    THANK YOU

  39. Svetlana ,

    Thank you for this post. It was a very informative and was highly helpful for me. I always wondered whether Look up with multiple criteria was possible. Got my answer today. But then I was trying to use evaluate formula to understand how it was actually working. This caused my excel sheet close abruptly. Just wanted to know whether it was possible or not to do EVALUATE FORMULA for cases that use Array .

  40. Hi Svetlana,

    I have a query re comparison of Vlookup and Index/Match functions:
    I deal with large tables [rows close to half a million or more] and the problem I face with using Index/match functions to replace Vlookup for these reasons:
    1. The table rows do not match as a large table will have a look for criteria in a smaller table and vice versa.
    2. The two tables compared have multiple values relating to lookup or match criteria.

    I have been able to solve with Vlookup, if there are only two values or text for one criteria - repeat the Vlookup formula twice: one with FALSE and another with TRUE and if the values or text are repeated use an IF formula to display one value or unique values. But if there are more than two values or text I am able to extract only two and not more.
    Is there any more condition that can be nested in Vlookup other than FALSE and TRUE?
    Some of the tables I use have 4 lines of description and all the 4 lines need to be picked up.
    If you need further details I can send you a sample excel sheet with dummy data.

    Regards, Ramki

  41. Hi there,
    I have hundreds of employees, which were grouped. Each group has its own supervisor, my question is, is there any formula to apply that anytime I type the supervisor's name or employee Id., all his group will automatically display underneath???

  42. I am using the Index and Match function to compare the values from column A to the values in Column C, if there is a match found then I am returning the value from column D which corresponds to the cell that matched from column C. Below are the queries I have and any help you can provide is greatly appreciated.

    1. If the value that I am returning from column D exceeds 256 characters what do I do?
    2. If there are multiple matches found in column C then is there a way for us to populate all the values from column D [for the matched C cells] and put them in one single cell in the column A.

  43. Hi, I am using INDEX($D:$D, MATCH(A1, $B:$B, 0)) to find a value in column D corresponding to the row in column B where my search value is found. It works great.
    However, I now need to replace $D:$D with the result of a search. I.E. I want to search the column headers for a string to find the column I need to look down to find my value. I don't want to hard code $D:$D but make it variable based on where the header is. The reason is my imported data doesn't always put the value I'm looking for in column D but the header is always the same no matter what column it ends up being. Basically a search for a string in 1:1 that returns a column array instead of a column number. Hope you can help.

  44. I need help with a formula.
    In column B (Invoice Source A)I have a list of invoice numbers.
    In column C (Source A Description) I have the description for what represents column B.
    Column D (Invoice Source B) is a subset of the invoice numbers in Column B.
    Not all of the numbers in Column B are in Column D.
    Column E (Added Description for Source B)is blank.

    My Goal: I want Excel to look at the number in Column D and search for its match in Column B, then look in column C for the description and copy that description into column E.

  45. Hi, I have referred to your INDEX /MATCH with multiple criteria example.
    and have a one question on how do we GET the next result if there's a match or duplicate of those 2 criteria (1st being Dan Brown, 2nd being Apples)

    Dan Brown Apples $271
    Dan Brown Apples $300

    The first result will be $271 if formula is used correctly.
    How do I get the 2nd result? which is $300

    Very much appreciated.Thanks.

  46. There is an error on the MIN/MAX example table. The "Results" are listed incorrectly. You seem to have switched the MIN and MAX example answers.

  47. I am using the following formula and it is working fine. It is pulling dates. When I try to do a sort oldest to newest the dates change. Can you tell me if there is something in my formula that causes this?

  48. hi
    ok I'm using open office which does not have IFERROR.i have two lists of names one long(50 names)one short (10) each list also has a cell with a number in it.
    the number MAY change in the short list ,so I use vlookup to find the name from the long to the short and change the value in the cell,But if the name is not found its gives an error and I want the value in the cell(long list) to just stay as It is ,if the name is not found in the short list.
    I think index match might work but not a clue how to do it.
    So how do I do that please..
    john

  49. I have a formula which works well but I need it to go further and return a blank result if the source cell in the other sheet is also blank. Otherwise the formula returns the value "0-Jan-00", since the cell format is suppose to return the date from another tab. The current formula is:
    =IF((ISNA(MATCH($E4,Sheet!$H$9:$ACW$9,0)+4)),"",INDEX(Sheet!$H$10:$ACW$13,4,MATCH($E4,Sheet!$H$9:$ACW$9,0)+4))
    Thank you

  50. Hi I'm still unclear on where "1" came from in the chapter of "Look up with multiple criteria using INDEX MATCH"

    Is there any hidden formula to return "1" value ?

    • Hi Jacob,

      I guess you are asking about this part of the formula:

      MATCH(1, (A2='Lookup table'!$A$2:$A$13),0) * (B2='Lookup table'!$B$2:$B$13)...

      There is no hidden formula, 1 is "hardcoded" in the Match formula as the lookup value. The formula checks two columns in the main table, column A ("Customer name") and columns B ("Products"), for matches in the lookup table. If the match is found, the above equation returns "1", otherwise "0". And that is why we use "1" as the lookup value, we just want the MATCH function to return an item's position only when both criteria are true.

      • sorry for bothering you. as i'm beginner,i understand your intention why you put hardcoded "1". Without any formula like "if", excel current sytx enables user could compare and return either "1" or "0" ?

        • Hi Jacob,

          Generally, yes. More precisely, the functions return the logical values of TRUE that equates to 1, and FALSE that equates to 0.

          In fact, I started to write a more detailed explanation for you, and ended up re-writing that part of my blog post :) Please check out the revised Look up with multiple criteria example. Hopefully the current explanation makes more sense. And thank you for your question!

          • Thanks for your kindness :)

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)