+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : vlookup not working in every cell

Hybrid View

  1. #1
    Registered User
    Join Date
    11-16-2010
    Location
    USA, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: vlookup not working in every cell

    I appreciate the replies. I used Paul's formula in the TE section of my sheet and it worked perfectly. =IFERROR(INDEX(BU$2:BU$1000,MATCH(2,1/(BT$2:BT$1000=A6),1)),"")

    I guess I don't completely understand the Index Match formulas because I can't get it to work in the rest of the sections.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: vlookup not working in every cell

    INDEX ( return_range , position_in_range )
    MATCH ( lookup_value , lookup_array_or_range , type )

    In an INDEX/MATCH function, the MATCH portion is returning the position_in_range to the INDEX function. It becomes:

    INDEX ( return_range , MATCH ( lookup_value , lookup_array_or_range , type ) )

    In your case, you want to return values from column BU (BU2:BU1000), so that becomes the "return_range".

    In the MATCH function you would normally provide a lookup_value (or cell reference containing that value), a column to search and a match type (-1, 0 or 1).

    Match type 0 looks for an exact match. Type 1 looks for an approximate match in a list that is sorted in ascending order. It will return the largest value less than or equal to the lookup value. Type -1 looks for an approximate match in a list that is sorted in descending order. It will return the smallest value greater than or equal to the lookup value. See Excel help for examples.

    In this case, rather than searching a range of values for a specific value, I'm doing an approximate match and searching an array of values for 2. The array is created in the "1/(BT2:BT1000=A6)" part of the formula when you press CTRL+SHIFT+ENTER (array-entering a formula). This results in an array like "1/(TRUE;TRUE;FALSE;FALSE;FALSE)" which in turn becomes "1;1;DIV/0;DIV/0;DIV/0" because TRUE=1 and FALSE=0. 1 divided by 1 = 1 while 1 divided by 0 = DIV/0 error.

    Since I'm trying to match 2 to an array of 1's and errors, the MATCH function will return the position of the last entry in the array that is less than or equal to 2 - in other words, the last instance of 1.

    It's always tough to explain these things in words. If you select the cell and then Evaluate Formula (Formulas tab, Formula Audition section, Evaluate Formula) you will see each step as you walk through it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1