+ Reply to Thread
Results 1 to 4 of 4

Auto populating cells below with vlookup

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    20

    Auto populating cells below with vlookup

    I don't know if this has been asked before but I do not have time to search all the threads for the topic. I have sheet1 that contains numerous cities and sheet2 that contains unique city names and zip codes. I used vlookup to search sheet2 to find the zip codes and populate sheet 1. My formula is =VLOOKUP(A2,Sheet2!A2:C142,3,FALSE). This works fine and I am able to populate the first row (acutally the second row because the first row contains the header). I then put the cursor at the bottom right corner to get the plus sign and click to try and autopulate all the other cells with this formula. What is happening is that all subsequent cells populate at #N/A because the formula increases the cell numbers by one. For example, the formula for the next cell becomes =VLOOKUP(A3,Sheet2!A3:C142,3,FALSE) and it should be
    =VLOOKUP(A3,Sheet2!A2:C142,3,FALSE) because A2:C142 is the array from Sheet2, not A3:C142. The lookup column
    A2, A3, etc. increases by one is correct but how do I prevent the array from increasing by one? It should always be
    A2:C142, not A3:C142, A4:C142, etc...

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Auto populating cells below with vlookup

    Without applying "$" to your column and row references, they will adjust as the cell containing them moves. This is called relative referencing.

    To make your reference absolute, place a $ sign in front of each row and column.

    =VLOOKUP(A2,Sheet2!$A$2:$C$142,3,FALSE)

    Alternatively, you can highlight the range in your formula: Sheet2!A2:C142 and hit F4
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    07-19-2011
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Auto populating cells below with vlookup

    Thanks daffodil11. Your suggestion with the $ worked perfectly. Prolbem sovled. I added to your reputation. Thanks again.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Auto populating cells below with vlookup

    No problem.

+ 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. New here and need help with auto populating cells
    By fstefanelli in forum Excel General
    Replies: 17
    Last Post: 01-05-2014, 09:20 PM
  2. Excel 2007 : Auto Populating cells
    By Gary Evans in forum Excel General
    Replies: 1
    Last Post: 11-23-2011, 04:17 AM
  3. auto populating cells
    By hnnn in forum Excel General
    Replies: 1
    Last Post: 11-05-2010, 11:31 AM
  4. Auto populating cells
    By hnnn in forum Excel General
    Replies: 7
    Last Post: 11-04-2010, 06:29 AM
  5. Auto Populating Cells
    By jokla in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-24-2008, 09:56 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