+ Reply to Thread
Results 1 to 3 of 3

Unclear Vlookup parameter

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Unclear Vlookup parameter

    Hi all,
    This is a piece of code I am unable to comprehend.

    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],LOOKUP!C[-7]:C[-6],2,FALSE)"

    Can anyone please let me know, what is this value

    Table_array = LOOKUP!C[-7]:C[-6] does here.

    I know there is a LookUp function but for either of its 2 versions, atleast 2 parameters are required and the parameters are enclosed within a (). We have a ! here.

    Thanks in advance.
    Please guide me.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Unclear Vlookup parameter

    R1C1 notation

    Anything appearing within [ ] post R/C is a relative adjustment in relation to the cell in which the formula is being posted.

    Assume ActiveCell is J10 then

    R[2]C

    refers to J12 ... 2 rows down, no adjustment on Column

    RC[2]

    refers to L10 ... no adjustment on Row, 2 columns to Right

    R[-3]C[-1]

    refers to I7 ... 3 rows up, 1 column left

    RC

    refers to J10 ... no adjustment

    Any numbers that appear post R/C not encased within [ ] are absolute references, again, with J10 as Active Cell

    R1C

    refers to J$1 ... the Row is absolute, no adjustment to Column which remains "relative"

    R1C3

    refers to $C$1 ... both Row & Column are now Absolute

    R1C[1]

    refers to K$1 ... Row is absolute but Column is adjusted one to the right.

    The reference need not contain both row & column ... ie to refer to an entire row

    R[-3]

    refers to 7:7

    and to refer to an entire column

    C[1]

    which would refer to K:K


    So taking all of that and for sake of demo (and continuity) we assume Active cell to be J10 then your formula:

    =VLOOKUP(RC[-1],LOOKUP!C[-7]:C[-6],2,FALSE)

    is basically translated as:

    =VLOOKUP(I10,LOOKUP!C:D,2,FALSE)
    Last edited by DonkeyOte; 09-29-2009 at 03:48 AM.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Unclear Vlookup parameter

    LOOKUP as used here is the name of a worksheet, rather than a function, which is why it is followed by an exclamation mark.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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