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. Hi,
    I have data in a worksheet like

    Date Line absent %
    8-Jan-17 A-1 7%
    9-Jan-17 A-1 6%
    10-Jan-17 A-1 3%

    I want to get this data in another worksheet, where I will enter date and line name then the absent% will come automatically. Could you please help me ?

  2. Hi Svetlana,
    This is an excellent blog! Could you please help me with this question? Using the Sample Data below, what formula(s) could I use to lookup the Product Number and find all of the Product Names assigned to that Product Number? (Please see Expected Results below depicting how I'd like to summarize the results from the Sample Data.)

    Sample Data
    Product Number Product Name
    111 Zoloft
    111 sertraline
    222 Advil
    222 ibuprofen
    222 Motrin
    333 Advair
    444 amoxicillin
    444 Amoxil
    555 APAP
    555 Tylenol
    555 acetaminophen
    666 Vimovo

    Expected Results of the Formula(s)
    Product Number Product Name
    111 Zoloft, sertraline
    222 Advil, ibuprofen, Motrin
    333 Advair
    444 amoxicillin, Amoxil
    555 APAP, Tylenol, acetaminophen
    666 Vimovo

    Thank You,
    Reba

  3. Thanks very much for posting this! It helped me potentially hours of work and lowered the chance of making manual errors.

  4. Hi Svetlana,
    I've spent the entire day on this blog searching for a way to solve the problem given inline and I must say WOW you are an amazing expert :), hope you will be able to help me too with the following problem and advise which formula to use for the following problem:

    I have a list of cca. 18.000 customers mixed in cca 100 cities inside one country.

    Country is divided by 8 regions where 1 region has cca 7-8 cities under it. I have a separate table/list which cities corresponds to which region.

    I need to assign each of the 18.000 customers to a specific region, based on the city they are in.

    Logic of the list is:

    Column B2:B18001 contains cities names (multiple customers per one city)
    Separate table has a list of all cities under one specific region (in total 100 cities divided in 8 regions - with luckily no overlaps or false entries)

    I need the formula that will find all cities in column B that belong to these 8 regions and in the column C place a corresponding region name next to the city value (do 'cities per region' division).

    So it's all textual data, with multiple 'recognise' and IF 'city1' 'city2' 'city3'..... - THEN 'region 1' and repeat for the 7 other regions.
    Can you help me please?
    I've been searching for a solution for hours and starting to think that the fastest way would be if I manually do all 18.000 entries :(

    Many thanks in advance!
    Vila

    • Hi Vila,

      It's definitely not a trivial task :) To make things easier for us to understand, can you send a sample sheet and expected result to support@ablebits.com?

  5. Hi Svetlana,
    How do I do this? :
    I've given cell N2 a name("myRef") which contains "B5". I wanna be able to write sth like "=2 * DEREFERENCE(myRef)" instead of writing "=2 * B5". What can I write to DEREFRENECE that cell's value?

  6. Svetlana,

    Thank you for this post! Very informative and I agree that too many people just rely on LOOKUP functions instead of these two. However, one thing you appear to have left out is when using this with text strings there is a drawback. Special characters break the MATCH function. For instance, if you are matching on a bunch of reason descriptions and one of them has a "/" somewhere in it the MATCH function fails while the VLOOKUP will still match it. This happens even with exact matches.

    Thank you,

    Alex

  7. How To I Find A Value From A Specific Columns Value?
    Ex: Column A1=1, A2=5, A3=10 And Column B1=2, B2=10, Column B3=15. Now I Find Number=10 From A1,A2,A3.

  8. USEFUL

  9. hi there, i believe i can do what i need to with this, however, i'm running into a problem getting it to work out.

    I have spreadsheet A and spreadsheet B.

    I am comparing spreadsheet A cells C1-C387 for matches against spreadsheet B cells C1-509 and when there is a match I want to return the value of spreadsheet B column D for that particular row/match and have it populate spreadsheet A column D

    Does this make sense? Thanks.

  10. Hello,

    I need some advice. I have a very large spreadsheet which hundreds of lines where I need to pull information from one column, based on the information in another.

    So far I can determine whether the initial column contains text from the range needed using =SUMPRODUCT(--ISNUMBER(SEARCH(($Y$2:$Y$30),A2)))>0 this is good as it identifies the list of rows which are affected, but means that i have to manually pull the information needed.

    How do I go about searching a cell for the contents from a series of others and if it is found returning the found information?

    Column A "Column B
    does Column A contain one of these?" If column A contains data from column B, put the data from column B here
    1.0_1234_text text 1234 ??
    1.0 5632_text text 7895 ??
    1.0_7895_text text 5278 ??
    1.0_3568_text text ??
    1.0_5278_text text ??

  11. I want to show year-to-date performance for sales people using data from monthly spreadsheets to give me year-to date figures. I used the following:

    =INDEX(MONTH1!C$16:C$29,MATCH($B16,MONTH1!$B$16:$B$29,0))+INDEX(MONTH1!C$16:C$29,MATCH($B16,MONTH1!$B$16:$B$29,0))

    and so on for 12 months. It works great for all sales people who have been here all year. However if the salesperson does not appear on one or more month's sheets I get the dreaded N/A. Please help :)
    Thanks

  12. Hi Experts,

    My requirement is : I have two excel sheets with 100 rows in sheet1 and 800 rows in sheet 2. I want to compare the sheet1 data whether is it there in sheet2 and if available that should highlight else ignore.

    Please advise if we have any mechanism to achieve this. Thanks for your inouts in advance.

  13. I have a formula of{=INDEX(B236:IN287,MATCH(B7,B237:B287,0),MATCH(B9,B236:IN236,0))} which works up until the 86th column but then returns an N/a when trying to find an answer in the 180 columns to the right.

    is there a limit to the number of columns that can be used? I have checked that all is well within the table, no merged cells no numbers as text etc etc

    im stuck as to why it doesn't work if you are able to shed any light please?

    kind regards

    Damion

  14. There are two sheets with the data, I have a requirement to check a column in both sheets and if there is any match then the entire row has to be replaced by the matching cell in the excel.Thanks

  15. Dears ,

    please tell me that , by using index/matching how we can find a specific range from a big reference of data ! . I'm having difficult using v lookup because of many raw and columns .

    please .

  16. WOW, Thank you, thank you, thank you a million times. It worked.

  17. Thank you for a great tutorial! I was able to get INDEX/MATCH working to auto-fill several different sheets in a document. Thank you for saving me from copy-paste!

  18. Hi Svetlana,

    I work with a spreadsheet in Excel that is the product of a CSV export from a web application. The export consists of a number of work tickets, each of which contains, among other things, a field with multiple values separated by commas. The CSV export results in one row per ticket, and it unfortunately creates a separate column for each of the comma-separated values that in reality are part of a single field. I never know ahead of time how many comma-separated values will be contained in the field in each ticket, so I never know how many total columns will be generated in the export, nor how many of the columns will contain a value for any given ticket. What I want to know is the number of values for each ticket.

    For example, lets say in each ticket there is a field named "label". For ticket 1, label="car, truck, plane, bus, ship". For ticket 2, label="plane, train". The CSV export will contain five columns with the word "label" in Row 1. Row 2 will have five label values, one value in each of the five columns. Row 3 will have label values in the first two columns, and the remaining three will be empty.

    I'd like to add a column with a formula to tell me how many values exist for each ticket. In the above example, the column would look like this.

    Number of Labels
    5
    2

    Can you help me with a formula for this?

    Any help is much appreciated.

    Dave

  19. Hi Svetlana,

    I need your help.
    I have a table with 3 columns contaiin Location name, Latitude and Longitude. I want to find a lat,lon for given location from above table. I used following formula to obtain it.

    INDEX(N3:N416,MATCH("Anuradhapura",M3:M416,0))
    The problem is lookup_value which is location name creates while joining 4 cells. Instead of writing location name within brackets, I want to give it as a function.

    Then above formula does not work.

    INDEX(N4:N417,MATCH('S (1)'!B550&'S (1)'!C550&'S (1)'!D550&'S (1)'!E550,M4:M417,0))
    please help me to overcome this problem.

  20. Hi, can someone help me, I have spent 3 hours trying to find what formula I need.

    I have 3 columns, 550 rows of data. Column A contains 25 options, Column B contains a 22 options for each of the options in column A, column C contains a number.

    I have done 2 dropdown lists for Column A & B. what i need is a formula to look at what i have selected in the cells that have the list and bring in the number from column C.

    Please help, Thanks

    • Hi Collin,

      You should use the following array formula:
      {=INDEX(C1:C550, MATCH(G2&H2, A1:A550&B1:B550, 0), 1)}
      The dropdown lists are in G2, H2.
      To enter this formula press CTRL+SHIFT+ENTER.

  21. Hi Svetlana,

    I need your help. I am in Recruiting.

    In recruiting a potential candidate would pass through different stages (sourced-> not suitable/reject/voice message-> submitted-> interviewed -> offered-> hired).

    The current ATS displays a single candidate at multiple stages (which gives me inaccurate report)
    What I need is to be able to pull proper report with total unique sourced candidates, not suitable candidates, voice messages etc.
    I need your help, if it is possible to have excel create a hierarchy system, where excel can pick one option (Interviewed), in case 2 or more options available (sourced, interviewed, left voice message etc).
    And this needs to be multiple criteria, as I would be lining them against different job IDs.

    Thanks
    Subash

  22. Good day Svetlana

    I have data in several columns, the most important are 6 columns

    1.Each set of data has unique number in column 1 (unique number start from 1 to …)
    2.Each unique number has a set of rows with identical description in column 2 (Comm. Payable x 2 rows, Funding Charges – this can be multiple rows, Trade Payable or Trade Receivable)
    3.Each unique number amount of items in column 3 (amount in only 1 row, same row Trade Payable or Trade Receivable from column 2)
    4.Column 4 and 5 are buying price and selling price respectively – on same row with Trade Payable or Trade Receivable from column 2
    5.Column 6 has profit & loss. Each description in column 2 rows has a value in this column

    # Description Items Buying Selling P/L
    86 Comm. Payable 0 0 -5
    86 Trade Payable 709 0.485 0.439 -32.61
    85 Comm. Payable 0 0 -5
    85 Trade Payable 1740 0.345 0.315 -52.2
    85 Funding Charges 0 0 -0.06
    86 Funding Charges 0 0 -0.04
    85 Funding Charges 0 0 -0.06
    86 Funding Charges 0 0 -0.04
    86 Funding Charges 0 0 -0.03
    86 Funding Charges 0 0 -0.05
    86 Comm. Payable 0 0 -5
    85 Comm. Payable 0 0 -5

    I want to change the descriptions in column 2 rows to be column headers, in a way that each unique number will now have only one row with summation of descriptions

    # Buying Selling Items Funding Charges Comm. Payable P/L
    85 0.485 0.439 709 -0.12 -10 -52.2
    86 0.345 0.315 1740 -0.16 -10 -32.61

    Thank you
    Ron

    • Hi Ron,

      Please try to do the following:
      1. Add the additional column G in your table with the following formula:
      =IF(COUNTIF(A2:A13, "="&A2) = 1, A2, "")
      Now you have only unique values for column A in column G.
      2. Add the additional columns with the following formulas:
      =SUMIF(A2:A13, G2, C2:C13) - to sum the Items column
      =SUMIF(A2:A13, G2, D2:D13) - to sum the Buying column
      =SUMIF(A2:A13, G2, E2:E13) - to sum the Selling column
      =SUMIF(A2:A13, G2, F2:C13) - to sum the P/L column
      3. Remove the blank rows to get the results.

  23. Hello Svetlana,

    Your tutorial is absolutely great. Thank you very much.

  24. Hi all,
    i need to sort the B no. column datas with respect to the A no. column datas, (both columns are text format)

    • Hi Jinson,

      Please try to do the following:
      1. Select the range with your data - A1:B100 for example.
      2. Select the Data ribbon tab and click the Sort button.
      3. Select the Column A in the Column.
      4. Click OK.

  25. I want formula for following condition.

    If age >22 then Basic*60% else if age =16 and less than 22 then basic*50% and if age=11 then basic*40% and if age=6 then basic*30% and age<=6 then basic*20%

    Regards
    Rajaraam

    • Hi Rajaram,

      You should use the following formula:
      =IF(A1>22, B1*1.6, IF(A1>=16, B1*1.5, IF(A1>=11, B1*1.4, IF(A1>6, B1*1.3, B1*1.2))))
      The age values are in Column A, the base values are in Column B.

  26. I want formula for following condition.

    If age >22 then Basic*60% else if age =16 and less than 22 then basic*50% and if age=11 then basic*40% and if age=6 then basic*30% and age<=6 then basic*20%

  27. i don't know if this is relevant, but i have 5 cells that all have a "=IF" function in so it will look at a cell and return "TRUE" or "False" value.
    what i want to do is, have it look at all 5 cells that were returned and number for the "TRUE" cell
    cell values are
    A2 = False
    B2 = False
    C2 = True
    D2 = False
    E2 = False

    then i want it to look at all 5 cells and return a number for the "TRUE" cell so the result must be "3" for this example
    the numbers that will be assigned to the cell will be

    A2 = 1
    B2 = 2
    C2 = 3
    D2 = 4
    E2 = 5

    how would i do this?

  28. Is there a way to autofill the array INDEX/Match Formula? I've created the formula in row 4 and need to drag it down and autofill though 2000 rows. Thank you in advance!

  29. Using this array,
    =LOOKUP(2,1/(Z$18966:Z$21192=G16930),AA$18966:AA$21192)

    is it possible to return the value?

    Thanks

  30. Can I return the value "" using this formula

    =LOOKUP(2,1/(Z$18966:Z$21192=G16930),AA$18966:AA$21192)

    Thanks

  31. Dear Svetlana. Thank you very much for you explanations.
    I have a qyuestion to you, taking the same data table in your explanation.
    I would like to now how to handle INDEX/MATCH in the following case:

    Below each product and in the same line of the customer, I would like to have the $ sum

    Products Lemons Apples Sweets Pies Biscuits
    Customer ___________________________________________
    Dan Brown ___________________________________________
    Jeremy Hill ___________________________________________
    Romert Acey ___________________________________________
    Tom Boone ___________________________________________

    Thanks

    Carlos

    • Hello, I'm sorry, I manage to see my mistake in writing the formula, and make it work.

      Thanks anyway

      Carlos

  32. Good day Svetlana,
    I downloaded the examble 'index-match-multile-criteria'. It works beautifully, but when I use the same type of argument in my sheet it does not want to work. I have tried and changed and even typed in the formula with the exact spacing etc.. Nothing!! Somewhere I did something wrong. Please have a look and help me out!

    • Hi Lida,

      Please send the sample workbook to our support team (support@ablebits.com) or upload it to Excel Online and post a link here, and we will try to help.

  33. Hi i currently using index and match function in excel, to auto match and index the value back, if i put a set of new data to compare with my original data.

    But however sometime a new data had a multiple result , how to i auto insert a row on the original data columns for the multiple result?

    this is my formula code : =INDEX($L:$L,MATCH($A:$A,$K:$K,0)) it could match and bring back the index value back i wanted ... but those with multiple result it only return back to the first result it show.

  34. Hello.. I now actually trying using index match/IF function to try to index the value from "ColE" onto "ColB" , by matching "ColA" compare with "ColD".

    For my eg. Shown below "Urr" got different value in "ColE" how to I insert the three different "Urr" with the different number
    result in "ColE" onto "ColA" with the same exact result number should appear in "ColB"???
    And "colA" "Usw" data still match with "ColD" "Usw"?

    Eg.

    ColA
    Doman
    Urr
    Usw

    ColD ColE
    Doman 1234
    Urr 12345
    Urr 12345
    Urr 12346

  35. Hello.. I now actually trying using index match/IF function to try to index the value from "ColE" onto "ColB" , by matching "ColA" with "ColD".

    For my eg. Shown below "Urr" got different value in "ColE" how to I insert the three different "Urr" with the different number
    result in "ColE" to "ColA" with the same exact result number should appear in "ColB"???
    And "colA" "Usw" data still match with "ColD" "Usw"?

    Eg.
    ColA ColB ColD ColE
    Doman Doman 123
    Urr Urr 1234
    Usw Urr 12345
    Usw 222

  36. Hello.. I now actually trying using index match/IF function to try to index the value from "ColE" onto "ColB" , by matching "ColA" with "ColD".

    For my eg. Shown below "Urr" got different value in "ColE" how to I insert the three different "Urr" with the different number result in "ColE" to "ColA" with the same exact result number should appear in "ColB"???

    Eg.
    ColA ColB ColD ColE
    Doman Doman 123
    Urr Urr 1234
    Usw Urr 12345
    Urr 123456
    Usw 222

  37. Hi,
    Please help..
    I have a storage tank calibration shown below. it has one column is height and the the corresponding volume on the next column. The table has wide range of cell. columns were height-volume-height volume and so on. If the table has only two columns then I will use =vlookup(value of I want to look up,range of cells table,the column number in range containing the return). Now since the height and volume is arrange in more columns how will I get the right value of I want to look up?? Please see sample.. Thank you

    height volume height volume height volume
    cm. lit cm. lit. cm. lit.
    1.00 107 41.00 38244 82.00 77620
    2.00 579 42.00 39204 83.00 78580
    3.00 1325 43.00 40164 84.00 79541
    4.00 2230 44.00 42125 85.00 80501
    5.00 4149 45.00 42085 86.00 81462
    etc...

    Regards.
    Mike

  38. Hi,

    I want to use a MATCH function as follows:
    =MATCH($B2,$B3!$A1:$A10,0)

    Here, the values of the cells B2 and B3 are dynamic. I have different sheets, for which I specify the name in B3 cell.

    Can someone please suggest a solution for my requirement.

    Regards,
    Ravi.

  39. hello
    Dear Svetlana,
    If i have three condition can i make the formula like :
    =INDEX(Sheet1!$G$2:$G$71,MATCH(C$4,Sheet1!$C$2:$C$71,0),MATCH($B6,Sheet1!$E$2:$E$71,0),MATCH($A5,Sheet1!$D$2:$D$71,0))

  40. Dear Svetlana,

    three days ago I stopped on your website and found very useful information about excel.
    I tried to find solution for my case(VLOOKUP,INDEX MATCH)but without success.
    Maybe you can help me ?
    I have two tables. First table which is in one sheet has 2 columns(1.ident number of product and 2.quantity).
    Second table which is in another sheet has also 2 columns(1. ident number of product and 2. price)
    Numbers of products(in raws) in first table are larger than the numbers in second table and first table includes all products(raws) from second table.
    How I can multiple quantity and price from theese tables ?

    Best regards,
    Krešo.

  41. hello

    I need help, I have 3 different suppliers for same products with different Artikel number and product name but with the same barcodes.
    Some of the product is cheap by the supplier number one but some the products are cheap by the supplier number 2 or 3.

    Now my question is this: Each supplier have more than 2000 products and it is very difficult to go one by one to find out who is selling for a good price and which product from three different suppliers.

  42. Hi,
    I have a Table 'Project Register' and within it I have 3 fields/columns - Client, Program, and Project. There are also fields set as named ranges for the above, using a validation formula to return valid options (working fine).

    My issue is the below formula returns NA# instead of an array of row numbers where the fields are blank, or when they match one or more criteria. (IE; All = ""; Program and Project are blank when client is selected; OR when Client and Program are selected, but Project is blank)... I can't see where the formula has gone wrong. Evaluation step through shows ok to the point of returning the row numbers. Your assistance is appreciated.

    =IFERROR(INDEX(Project_Register[Project Name],
    IF((Client="")*(Program="")*(Project="")),1,
    IF((Project_Register[Client]=Client)*((Program="")*(Project="")),1,
    IF(((Project_Register[Client]=Client)*(Project_Register[Client Program]=Program))*(Project=""),1,
    IF((Project_Register[Client]=Client)*(Project_Register[Client Program]=Program)*(Project_Register[Client Project Name]=Project),1,0)))),ROW(Project_Register[Project Name]),0),"")

  43. Very helpful, thank you!!

  44. Clarification: the formula I posted above references column "B" multiple times. That is actually on another tab in the spreadsheet and is where I'm placing the results of the formula.

  45. I'm trying to create a unique list of names, from two columns containing names, but only include names that fall between a date range. Example, column A has dates, column B has a name, and column C may (or may not) has another name. Given a Start date and an end date in some other cell (say in J1 and M1), is there a formula that will return a list of unique names from both columns B & C (same names may be included in both columns, but are never the same on the same row), that have a date that is within the given date range? I've been able to get the unique list of names using this formula ("Salesperson1" and "Salesperson2" are named ranges equivalent to columns B & C in my example above):
    {=IFERROR(IFERROR(INDEX(Salesperson1,MATCH(0,IF(ISBLANK(Salesperson1),1,COUNTIF($B$3:B3,Salesperson1)),0)),INDEX(Salesperson2,MATCH(0,IF(ISBLANK(Salesperson2),1,COUNTIF($B$3:B3,Salesperson2)),0))),"")}

    Any help would be appreciated.

  46. -20%
    -25%
    -27%
    -23%
    -19%
    As above I have a number of values and I want to reduce an array of values say by 7
    The result becomes
    -13%
    -18%
    -20%
    -16%
    -12%
    What formula can I use in excel to get this value ?

  47. Hi

    I have two columns in a file. Date (Column A) and Amount (Column B)
    Date Amount
    8/22/2016 600
    8/23/2016 600
    8/24/2016 200
    8/25/2016 800
    8/26/2016 600
    8/27/2016 600
    8/28/2016 600
    What I want to achieve is described below.

    In another sheet, I have certain dates. Not all the dates from above, but specific dates as below. And what I want to achieve through a formula is what is under column Sum.
    Dates Sum
    8/23/2016 =600+600
    8/25/2016 =200+800
    8/28/2016 =600+600+600

    I'll explain the formula I want taking 8/28/2016 as an example.
    I have calculated the sum until 8/25/2016. So I want to look at the data
    from the next row after 8/25/206 until the date specified here, that is 8/28/2016 and then sum it up.

    If I take 8/25/2016 as an example, then I have calculated the sum until 8/23/206. Hence I would have to pick up the numbers from the row below 8/23 (from the data) which is 8/24 until 8/25 and then sum that up.

    Can someone please help me with this?

    • Sorry, I figured it out!! :-)

      =SUM(INDIRECT("Attendance!E" &Match(A22,Attendance!$A$1:$A$842,1)& ":E" &Match(A23,Attendance!$A$1:$A$842,1)))

      Cell reference here doesn't really match the example data I have given above, but you will get the concept

      • Correction, you need to add a + 1
        =SUM(INDIRECT("Attendance!E" &(Match(A22,Attendance!$A$1:$A$842,1)+1)& ":E" &Match(A23,Attendance!$A$1:$A$842,1)))

  48. Hi

    Thanks for this article. I want sum of all results that are there in selected data from index match instead of single result.
    =INDEX('LR CashFlow'!$B$2:$F$561,MATCH(1,('LR CashFlow'!$B$2:$B$561='LR CALC SHEET'!B8)*('LR CashFlow'!$F$2:$F$561='LR CALC SHEET'!$D$6),0),3).

    Can you kindly help me in this.

    Thanks

  49. Hi I am trying to find a value in Column A and I know the value in Colum B.

    For example, I have placed a value from Column B, cell B10 in a parallel sheet. next to that I want to place the value of column A, cell A10. can I please have any advise on this ?

    • Please do not respond to this , I have reached the solution !

      Thanks :)

  50. My question is, is there a way I can create a formula that will pull out code words from a variety of words that are listed in a cell? I have a column in which notes are listed but I would like to be able to find trends by using a formula to count key words listed within the notes.

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