+ Reply to Thread
Results 1 to 6 of 6

Vlookup returning #N/A

  1. #1
    Forum Contributor
    Join Date
    01-25-2005
    Location
    Cardiff, Wales
    MS-Off Ver
    Mac 365 & M/S 365
    Posts
    107

    Vlookup returning #N/A

    Hi all,

    I'm using excel 2007 (but this shouldn't be an issue), I have created an unique ID for each of my Customers on "Customers table".

    I want to look at the table and place in another table all the most important info on each customer e.g.

    customer id Address Last Order Price

    The sells info is on the sales table, so I want to lookup customer id on first table and get the sell data from the second table.

    I tried =VLOOKUP(A1,'customer table!'A1:C45,5,False)

    A1 is the customer id and 5 is the column number which could return the address, but all I'm getting is the return #N/A.
    Last edited by Clash; 10-03-2007 at 05:32 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your range has 3 columns (Col A to C) and your criteria is set to return col 5.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    01-25-2005
    Location
    Cardiff, Wales
    MS-Off Ver
    Mac 365 & M/S 365
    Posts
    107
    VBA,

    sorry about the title.

    The address info is on a second spreadsheet in column 5.

    =LOOKUP('customer table!'A1,'Sales!'C$2:C$329,5,false)

    This is how it should look, customer id in cell A1 on customer table, the address is in column 5 on the sales table.

    but I'm still getting the #N/A, but I know the address is there.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Change the 5 to 1 as the table only has one col.

    e.g Col is C = 1 col in table


    =VLOOKUP('customer table!'A1,'Sales!'C$2:C$329,1,false)

    VBA Noob

  5. #5
    Forum Contributor
    Join Date
    01-25-2005
    Location
    Cardiff, Wales
    MS-Off Ver
    Mac 365 & M/S 365
    Posts
    107
    I have attached a quick file to show what I mean.
    Attached Files Attached Files

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You need to match the lookup cell value with the first column

    The example below looks at D2 on Sheet Customer Table (J-B-7YG) and then looks at sales sheets Col A to C.

    I entered 3 as the col to return the value. By entering 1 it will return J-B-7YG and 2 will return the address line - 1, the road

    =VLOOKUP('customer table'!D2,sales!A:C,3,FALSE)

    Hope that helps. Link shows you more

    http://www.contextures.com/xlFunctions02.html


    VBA Noob

+ 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