Comments on: Advanced VLOOKUP in Excel: multiple, double, nested

In this VLOOKUP tutorial, you will find a number of advanced formula examples that demonstrate how to look up with multiple criteria, use two VLOOKUP functions in one formula, dynamically pull data from different sheets, and more. Continue reading

Comments page 12. Total comments: 540

  1. I am using the following formula as an array, but am getting blanks. Can you help resolve this please.

    =IF(ISERROR(INDEX(Table_ExternalData_1[#All],SMALL(IF((Table_ExternalData_1[UserName]=$B$1)*(Table_ExternalData_1[comm_datetime]>=$B$2)*(Table_ExternalData_1[comm_datetime]=$B$2)*(Table_ExternalData_1[comm_datetime]<=$C$2),ROW(Table_ExternalData_1[UserName])),ROW(1:1)),4))

    Basically trying to retrieve data using 3 criterias.

  2. how to advance xxl

  3. Maria,
    I have sent in the excel file that I'm developing.

  4. How to do two-way lookup in Excel??
    in this you have showed how we could find second match result for the selected item only LEMON. which is very nice.
    If suppose Same I need find for more than 20 items from the Raw data like more than 500 do I need to enter all 20 items individually or there is any short way for this.

  5. Hi,

    if i have below column or rows,

    upc article no description
    8901725121112 10108458 furnish ang

    is it possible if i want description by upc and by article no in one cell.

  6. Hi,
    I have a Main table with many columns and rows. I have create a bill of matrials taking data from different columns. When I put a formula

    =INDEX(B$4:$B$9,MATCH(F5,$A$4:$A$9,0),MATCH($G$3,$B$3:$D$3,0))/$B$10*$G$10

    it also generate zero (0) values in rows data was not available.
    My question is: I want to generate data with value in initial rows.

    Kind regards,
    Waseem

  7. I have an excel spreadsheet that I'm attempt to do a vlookup or index to get detail of the monthly cost for cell phone to the first tab of a worksheet.
    I have a tab for the details of multiple cell phones by month. it includes base costs, total minutes, text message, GB used, and so on.
    I would like the front tab to pull the current month data from the detail sheet so the data can be reviewed monthly.
    So I have created a tab that has the phone number, then a drop down menu for the month, then I need it to pull the data for that cell for that month.

    This is where I get lost. I can get the data for the first instance but when you change the date nothing happens. I would appreciate any help you can provide.

    1. Hello, Lance,

      To help you better, we need a small sample table with your data in Excel. You can email it to support@ablebits.com. Please add the link to this article and your comment number.

  8. Hi,

    I'm currently looking for a function, that helps me sum up the numbers corresponding to the duplicate data in a different worksheet and this value to be brought to another sheet by vlookup.. In simple terms, a function that sums up and vlookup.

  9. Parameters:
    Name Start Date End Date Value
    A 01-Apr-11 02-Feb-12 2
    A 03-Feb-12 01-Mar-12 3
    A 02-Mar-12 31-Dec-13 4
    A 01-Jan-14 31-Jan-14 5
    B 09-Jan-13 04-Apr-14 6
    B 05-Apr-14 07-Feb-15 7
    B 08-Feb-15 01-May-16 8
    B 02-May-16 01-Jun-16 9

    Name Date Value
    A 30-Apr-12
    A 05-Feb-12
    A 30-Jan-14
    B 07-Apr-14
    B 20-Feb-15

    Please help for for the above value column based on provided parameters.

  10. Dear Sir,

    I am doing vlookup in my time sheet there is four sheets i have done 1 sheet only balance 3 sheets i can't find please help me.

  11. Dear Sir,

    I Want to update leave code in attendence sheet according to leave trransaction on the basis of Employee code and respective dates from start date to end date remaining values in main sheet should be constant.

  12. need your help on this. I want to vlook up for the specific number from another worksheet but the leftmost value is the combination of samenumber and some text I want the value in the 4th column. pls help

  13. great site......

    could you help me with the below query.....

    I am doing vlookup, my ref column will have duplicate but I need all their corresponding items in one single cell line by line... can u help me on this....

    1. Hello Sudhakar,

      Thank you for your feedback.

      I'm sorry, but we don't know of a simple way to get all values in one cell. You may need to use VBA for this task.

      You can get all values in different cells, please see the "Get all duplicate occurrences of the lookup value" section for a detailed description.

      Then you can use the Concatenate function to merge all the values you get into one cell. Please see this post for more information:
      https://www.ablebits.com/office-addins-blog/excel-concatenate-strings-cells-columns/

  14. I have 4 columns of Reg. No. Name Subject and Grade. I want to return the grade of specific subject of a student how can I use the vlookup formula.

  15. I love this Page.... I am a self learner and got lot of help from this page....

  16. I have a large data for groups for e.g.

    GRP_1 GRP_2 GRP_3
    98465 5521 65466
    65468 6663 6541
    68465 6545 36541
    65466 8466 6541
    65466 9548 65666

    and I want to create a list of products and which group it belongs like

    Product Groups
    5521 ??
    6541 ??
    6541 ?
    6545
    6663
    8466
    9548
    36541
    65466
    65466
    65466
    65468
    65666
    68465
    98465

    Thanks

    1. Hello, Ashwin,

      Please try this formula:
      =IF(ISERROR(MATCH(E2, $A$2:$A$6, 0)), IF(ISERROR(MATCH(E2, $B$2:$B$6, 0)), IF(ISERROR(MATCH(E2, $C$2:$C$6, 0)), "",$C$1), $B$1), $A$1)

  17. Hey,

    I loved you instructions! I have one question.
    I am using INDEX MATCH to find a cell from another workbook and place the name of the cell near it. For example:

    =INDEX('[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$A$8:$A$75,MATCH($B$10,'[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$C$8:$C$75,0))

    Which works fine. But sometimes the "time" in the cell changes. For example $B$10 is "6:00 AM - 2:00 PM [Breads Sales]" but sometimes I use an employee that is only "6:00 AM - 1:30 PM [Breads Sales]". How can i make INDEX MATCH use 2 lookup values incase the first one fails?

    1. Hello Argenis,

      Try the IFERROR function that allows you to return another specified formula if the first one returns an error:

      =IFERROR(INDEX('[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$A$8:$A$75,MATCH(_$B$10_,'[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$C$8:$C$75,0)),

      INDEX('[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$A$8:$A$75,MATCH(_$B$11_,'[Schedule 11.30.15 Hotschedules.xlsx]Sheet1'!$C$8:$C$75,0)))

      https://support.office.com/en-us/article/IFERROR-function-c526fd07-caeb-47b8-8bb6-63f3e417f611

      1. Thank you, It worked wonderfully!!!

  18. Below was the table my scope of search

    Customer Name Product

    Brown Apples
    HILL CHock
    Brown Sweets
    Acey Lollypop
    Wolf chikky
    Brown Biscuits
    Hill Alapino
    Wolf Jelly
    Hill gems

    Search Cell in the same Sheet like the following

    $G2 $H2

    Dan Brown Apples
    Sweets
    Biscuits

    $G$5

    Hill ????
    ????
    ?????

    wolf

    I had used the following formula to get the first set of search:
    =IFERROR(INDEX($C$2:$C$16,SMALL(IF($G$2=$B$2:$B$16,ROW($C$2:$C$16)-1,""),ROW()-1)),"")

    I like some help to expand (or) new formula to list all the duplicate values with respect to the string mention within the Left side, instead of hardcording the right side formula....that is $G$2

    Thanks for looking and trying to help me out...!!!

  19. hello,

    a have a question based on your example please:

    if a have the next situation:

    Dan Brown A B
    Dan Brown C D
    Jeremy Hill T I
    Dan Brown R T

    and I want to have the next result into another sheet :

    Dan Brown A B C D R T
    Jeremy Hill T I

    How can I do that?

  20. it seems that my formula isnt working ..i use your formula as refference but it always shows nothing.. anyone please help

    =IFERROR(INDEX(E5:E11,SMALL(IF(E2=E5:E11,ROW(F5:F11)-1,""),ROW()-3)),"")

    1. Lineth,

      Please make sure you press Ctrl + Shift + Enter to enter the array formula correctly.

  21. I am quite poor on excel and can do simple VLookups. I need to do one that I think should in corporate an If function but do not know how. I need it to Vlookup a selection of codes and return the rate from column 2. However for 1 code I need it to go to one list for the answer, for all other codes I need it to go to another list for the answer. e.g I have 10 carrier codes 9 of the codes have a fixed rate - easy but one of the codes has a different rate for every item. So for the 9 with a fixed rate easy however how do I tell it that if code is this odd one go lookup on this list but if not go lookup on that list? I have played around for days trying to work it out. hope that this makes sense

  22. Hi Alireza,
    for post 54. you can use the following array formula without sorting your first column:
    =max(if(b2:b15=e2,c2:c15))
    use CSE.
    Good luck.

  23. Dear all am looking for some help

    I have a cell with code in it and than a seperated sheet whit the same codes and some devided lanes exp
    cell M17 = TYO
    in sheet 2 I have a range A24 untill B 39 were TYO is mentioned 4 times in A and the in B there is TYO+ each time a different explanation

    now I would like to find a formula to place in sheet one M17 is TYO that the various explanations apeare

  24. Hi - I have a table with 3 columns: Course Name, Credits and Category
    IE
    100W 3 GE
    117a 4 GE
    17a 3 Comp
    56 3 Surveys

    I have a worksheet with the following columns: Instructor, Course Name, Total Credits

    Cindy Miller 17a 3
    Shannon Baer 17a 3
    Bill Jones 56 3

    I created a lookup table to calculate the total credits based on the selected course name and looking at the credits associated with same in the table.

    This works fine.

    Now I want to determine the quantity of courses for each Category.

    So in the example of Cindy, Shannon and Bill it would look like this:

    Category # of Courses
    Comp 2 (since course 17a is a category Comp and Shannon and Cindy are teaching)
    Surveys 1 (since course 56 is a category Survey and Bill is teaching)

    Can't wrap my head around how to get the count of courses offered by category.

    thanks for your help

  25. Dear Sir/Madam
    My query is that how I can use ">" & "<" greater than & Less than in single formula in excel sheet by solving the problem.
    QN.:Find the value greater than 250 and Less than 800.
    Example:

    Name Amount Age
    Bill 256.95 56
    Joe 125.63 22
    Mary 25.66 59
    Dave 548.00 21
    Frank 489.32 48
    Sue 500.25 19
    Hillary 368.59 15
    Kate 901.56 25
    Aleisha $99.95 33

  26. I have two spresdsheets - one having a customer name in column A and product name in column d and another spreadsheet having net price for the same criteria. The net price are different for same product for diffferent customers. I am trying to bring the net price to the first spreadsheet. What is the formula to use? Thanks

  27. Great help to me as a novice. Is there anyway you could assist with the following problem;
    In a cell I have a date which can be changed eg, Aug 2015, Sep 2015, Oct 2015 etc. This in essence represents the sheet name containing the main look up table.Is there a variant of the the vlookup formula below that:
    Updates the formula with the date (sheet tab name) based on the selection in the date cell?
    EXAMPLE: If Sep 2015 selected in date cell, then return the formula ,=VLOOKUP(A6,'SEP 2015'!$B$5:$L$287,7,FALSE).
    If Oct 2015 selected in date cell, then return the formula,=VLOOKUP(A6,'OCT 2015'!$B$5:$L$287,7,FALSE).
    Any help would be greatly appreciated thanks!

  28. I have two tables Main table and Vlookup table. Vlookup table as "place_table". Vlookup table has three sheets of seperated places sheet1 as Mumbai, sheet2 as Delhi, sheet3 as Chandigarh.In main table I am using vlookup formulas seperately =vlookup(b2 ,[place_table.xlsx]Mumabai!1:1048576,2,0), =vlookup(b2 ,[place_table.xlsx]Delhi!1:1048576,2,0), =vlookup(b2 ,[place_table.xlsx]Chandigarh!1:1048576,2,0). In main table I have seperate columb which shows places Mumbai, Delhi and Chandigarh. How can I use this columb to applying only one formulas to all

    for one formula for all three sheets.

  29. Hi again:)

    After a night thinking about the problem above I have answered my own question.

    To increment the "-20" I placed the following in an unused cell on row 20, (in my case this cell is in a column that is normally hidden).

    "=row()"

    this shows the row number & updates every time a row is added above it.

    I named this cell "row_increment"

    Then I adjusted the code above:-
    ),ROW()-20)),"Error")}

    to read:-

    ),ROW()-row_increment)),"Error")}

    So every time I add a new row ABOVE row 20 [=row()] automatically updated the -20 to -21, -22 etc
    My table no longer looses the top row

    I hope this makes sense to others.

    SteveN

  30. Hi

    I've copied and modified your example above for finding duplicate values.
    my code:
    '{=IFERROR(INDEX(expedite_report!$H$8:$H$32000,SMALL(IF($B$21=expedite_report!$A:$A,ROW(expedite_report!$H$8:$H$32000)-14,""),ROW()-20)),"Error")}

    This works very well thank you :)

    I have an issue tho'
    The worksheet is growing all the time with new rows being added which then impacts "ROW()-20". The $B$21 increments as new rows are added but the "-20" does not & I'm loosing results off the top of the array.

    How can I modify this code such that the "-20" increments when a new row or rows are added?

    SteveN

  31. I am trying to create a forumala which will allow me to do the following:

    eg. if the figure in A2 IS the greatest column A then it is 10 and if its 2nd Greatest it is 9 etc.

  32. If you send me some advanced excel formulas, I will be greatful....

    1. Hi SUBHAM,

      You can download a workbook with formula examples discussed in this article here.

      1. Thank you so mush its really helpful

  33. Hi, i have a table with thee sheets with numerous addresses on each sheet. I want to search each of the three sheets and only return the value if the address appears on all three sheets. How do I do this?

  34. This is wonderful, I have found this and one other article very helpful. One question, if you have a moment, can you refer me to an article similar to this but where the second look-up term is actually a range? For Names: John, Fred, Mark and Number of Items are either 0-10, 11-20, 21and greater.

    So basically, one would select John, and enter a number, say 19, and the returning would would be Red or if one A1=Fred, B1=25 - looking for a formula that would return the result of Warm - based on the example table below.
    Thanks!
    0-10 | 11-20 | 21 and up
    John Bronze |Red | Hot
    Fred Silver |Orange | Warm
    Mark Gold |Green | Cole

  35. Hello

    I would like to use the formula "How to do two-way lookup in Excel" and instead of getting the value at the intersection i would like to just paint or fill the cell with a color.

    Any help would be appreciated.
    Ralph

  36. see sample spreadsheet

    A B C
    item product cost
    9501 orange 3.5
    9502 apple 4.5
    9503 pear 6.0

  37. How can I combine two VLookup formulas together, for example the formula I am using is =if(A1=","",VLOOKUP(A1,PRODUCTS,3,FALSE)&IF(A1=","",VLOOKUP(A1,PRODUCTS,2,FALSE))) in return I am getting two answers when I only want one answer not both, if I enter criteria 3 I want to get criteria 3 and if I enter criteria 2 I want to get criteria 2 not both at the same time like I am getting now.
    item product cost
    9501

  38. Hi,

    Thank you for your very useful posts and I hope you can help with a problem I have:

    I have a cell (C6) which contains text based on a vlookup formula. I want another cell (G6) to return either "True" or "False" based on the text in C6. In G6 I have 'IF(C6="Air Cooled","True","False") but this doesn't work. If I just type "Air Cooled" into C6 then it's fine, G6 returns "True".

    Can you please tell me if there is a way around this?

    Thank you.

    1. Hi Anne,

      Your formula is correct and it should work both for values typed manually and returned by other formulas, and it works just fine in my test sheet. An immediate reason for the formula not working that comes to mind is that the value returned by your Vlookup formula has some slight difference in spelling, or a double space between words, leading or trailing space, etc.

  39. Hi, I was wondering if you could help me please?

    I am trying to do a two way VLOOKUP , I have sales invoice numbers and purchase invoice numbers as the initial look up cells, I then want to search for these invoices in two other worksheets, I then would like to column next to the invoice number on the other sheets to appear. I have this at the moment but I does not appear to work,

    =IF(ISNA(VLOOKUP(D39,'Purchase Ledger Control'!B13:B33,2,0)),"",IF(VLOOKUP(D39,'Purchase Ledger Control'!B13:B33,2,0)="",""&IF(ISNA(VLOOKUP(E39,'Sales Ledger Control'!B13:B30,2,0)),"",IF(VLOOKUP(E39,'Sales Ledger Control'!B13:B30,2,0)="",""))))

    Thanks for your help in advance.

    Chris

  40. how i should proceed for more than two cloumn lookup criteria.

  41. I want 0 inspite of #N/A when ever vlookup comes up with no value (& there is also actually not any value against that respective reference).Can you kindly tell me how can I get that. I used If(iserror also but it brings "Blank" cell when there is #N/A but our requirement is 0.

    Help is greatly appreciated

    1. Hi Assad,

      You can use the IFNA function with 0 in the second argument, like this:
      =IFNA(VLOOKUP(), 0)

      If you want the formula to bring 0 instead of any errors, not only #N/A, then use the IFERROR function:
      =IFERROR(VLOOKUP(), 0)

  42. Hello,
    Can you explain how to get all Duplicate values in a lookup range, looking up values in a different worksheet(of the same workbook)?

  43. Hi!

    This was very helpful.
    If i want the multiple results to be displayed in columns how will i do it with this?

    {=IFERROR(INDEX($C$2:$C$16,SMALL(IF($F$2=B2:B16,ROW(C2:C16)-1,""),ROW()-3)),"")}

    Thank you!

  44. Thanks for the great post. Nevertheless, I have been presented a problem to interpolate in a given lookup "string" which is concatenated a "value" . As an example :

    The string here would represent the pipe name, value is the pipe number, value2 represents the depth and value 3 is the x-coordinate.
    --String Value Value2 Value 3
    Pipe 1 200 50
    Pipe 1 210 60
    Pipe 2 200 45
    Pipe 2 250 60
    Pipe 3 150 50
    Pipe 3 200 55

    I'd like to create a lookup function which I can not only identify but interpolate the x-coordinate (value 3) at a given pipe depth (value 2) and pipe identification (String and value) .

    Naturally I have tried to use combined "helper" (=Pipe&3&150) but unfortunately excel treats this a string but not values. This can only work if I provide the exact depth which would return the exact coordinate value on the table.

    Any advice, my respected excel gurus?

    1. Izwan,

      For us to be able to assist you better, please send your sample workbook with the source data and expected result to support@ablebits.com. I am sorry, at the moment it is not very clear why you need interpolation.

  45. I am trying to use Vlookup in pulling out the grades from a transmutation table. Column A is the lookup value and column B is the equivalent grade. The values in A begin with 0 and increments of 0.01 while column B begins with 60. When this formula is used: =VLOOKUP(T4,Sheet2!$A$1:$B$10000,2,FALSE) the returning value is #N/A.

    Thank you for your help.

  46. Hi, I have been trying to figure this out for some time now so I hope you can help - I have 2 seperate spreadsheets that I need to combine into a sales forecast.

    Basically, I have 2 tabs in my sales and stock forecast -

    1st sheet has product SKUs in stock, and quantity
    2nd sheet has product SKUs and sales in units, not £

    I paste into the stock sheet from an external source, and also the sales from a different source - hence the seperation. The SKUs in stock may not always match the SKU sales, so I need to first match the SKUs, to save trolling through a large number of them, and then transfer over the sold units.

    eg:

    SKUs in stock
    tshirt 2
    bottle 4
    shorts 2
    cap 3

    SKU sales
    tshirt 1
    bottle 2
    cap 1

    So, I think, I need to match tshirt, bottle and cap in the forecast sheet and then match over the sales for each so I can then forecast the next stock.

    I hope this makes sense?!

    Many thanks in advance

  47. Dear all, I want data in below given foramt kindly help me

    Source Cell Neighour Cell Source Cell NB1 NB2 NB3 NB4
    A 1 A 1 2 3 4
    A 2 B 4 5 6 19
    A 3 C 7 8 9 10
    B 4
    B 5
    B 6
    C 7
    C 8
    C 9
    C 10

    Thanks

  48. I have 2 reports; one of previous report and one of current report.
    In the current report, I run vlookup against the previous report for dates to identify new entries and old entries. After which, I run true false to identify whether the dates of the previous report match/differs with the dates of the current report.
    The purpose is to check what are the new entries and also to check if there are date changes from the previous entries.
    The challenge is I create two columns, one for vlookup, one for true false.
    Is there anyway to combine both formulas and have just one column?

  49. Hi, seek help on below.

    Item1 1.05 A
    Item1 2.50 B
    Item1 7.85 C

    I need a formula to match both below:
    -item
    -price that could different by +/-0.50

    Example, if I lookup :
    a. Item1, 2.00 - Return B
    b. Item 1, 5.00 - Error

    Would really appreciate any help or just throw in any ideas as brainstorm. Thanks

  50. Team, i need code for below:

    Input:

    A 12
    A 11
    A 10
    B 11
    B 12

    Out put:
    A 12 11 10
    B 11 12

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