+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP define table array with just columns

  1. #1
    Registered User
    Join Date
    04-18-2011
    Location
    Manchester UK
    MS-Off Ver
    Excel 2007
    Posts
    5

    VLOOKUP define table array with just columns

    Sorry if this is just too obvious but I have always defined a Vlookup table_array using row and column coordinates. I was looking at a Vlookup formula in colleagues workbook and it defined only columns.

    So instead of what I would normally consider using:
    =VLOOKUP(A2,'sheet2'!$A$2:$G$100,2,FALSE)

    they had simply defined the columns:
    =VLOOKUP(A2,'sheet2'!A:G,2,FALSE)

    I couldn't find any reference to using Vlookup like this so I wondered if this is something others use, or whether there could be issues doing it this way. Obviously this is an easier way to enter particularly on larger datasets where you can simply drag the columns to define the table array.
    Last edited by sharpen; 07-21-2022 at 02:50 PM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: VLOOKUP define table array with just columns

    yes, you can use that way - but it will address 1,048,576 rows - depending on version of excel

    better to use a range
    if you want to future proof - say your range is $A$2:$G$100 but it grows
    then use
    $A$2:$G$100000

    would be better than A:G
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: VLOOKUP define table array with just columns

    IMO using entire columns has more drawbacks than advantages. One of the former is that you will be unable to use those columns for anything else. Your sheet might get bloated, etc.. ( because, once one uses entire columns, one tends to use it in all formulas where applicable..)
    OTOH as XL has the Excel Tables feature why not use this technique for ranges that might change?

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,081

    Re: VLOOKUP define table array with just columns

    IMHO... No issues here, but.

    1. Some functions work FINE with whole columns (COUNTIF(s), SUMIF(s), VLOOKUP, INDEX-MATCH, etc).

    2. Other's don't (SUMPRODUCT) which will calculate EVERY row.

    3. NEVER use whole columns with array formulae

    4. The only issue is that VLOOKUP returns the first matching result it sees.... so if your layout is poor... and a match for A2 occurs ABOVE the desired result... th eone above is the one you'll get.

    5. I tend to use whole columns where it's OK to do so.

    Others will, no doubt, chip in as well.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,081

    Re: VLOOKUP define table array with just columns

    And they have... and don't agree!

    https://fastexcel.wordpress.com/2015...a-or-bad-idea/

  6. #6
    Registered User
    Join Date
    04-18-2011
    Location
    Manchester UK
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: VLOOKUP define table array with just columns

    Thank you all for those great answers, and Glenn for that link to the other thread on the topic
    I’ll just stick with defining the row/columns in my arrays.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vlookup for multiple columns across table without dynamic array for older Excel versions
    By jaryszek in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-16-2020, 08:41 AM
  2. Vlookup with indirect to define the array
    By Rohirrim85 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-10-2016, 03:06 PM
  3. VBA Define columns to print on Active sheets array
    By folksteve in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2014, 11:36 AM
  4. Value in a cell to define an array for VLOOKUP
    By Awesomeau in forum Excel General
    Replies: 4
    Last Post: 07-07-2011, 08:04 AM
  5. Replies: 1
    Last Post: 05-12-2009, 03:40 PM
  6. Replies: 3
    Last Post: 03-01-2006, 08:45 AM
  7. [SOLVED] pivot table - Can I pre-define rows and columns?
    By WRBailey in forum Excel General
    Replies: 3
    Last Post: 05-17-2005, 02:06 PM

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