+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP query

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Inverness
    MS-Off Ver
    Excel 2003
    Posts
    14

    VLOOKUP query

    My VLOOKUP formula was working perfectly - it searched for a value (product code) in worksheet (B) and returned the appropriate price. However, when I copied & pasted the revised product codes and prices into worksheet (B), I now get an #N/A error.

    The columns in worksheet (B) haven't changed - just some of the prices and product codes. The product codes are in column A, sorted in ascending order. I have tried changing the format of these cells to Text or to General (they are alphanumeric, e.g. N0220, G2230), but I still get the error. However, when I manually overtype the (same) product code, the formula works... so it's something to do with how Excel sees the format of the product codes/cells.

    Any ideas?

    Thank you.

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

    Re: VLOOKUP query

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    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

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Inverness
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: VLOOKUP query

    Thanks for your reply. Attached are a couple of small samples - one spreadsheet where the formulas work, and one where they don't.

    In the spreadsheet where they don't work, the only change is that I have copied & pasted a spreadsheet from a supplier into the Worksheet 'ESS'.

    I hope it makes more sense with the samples!
    Attached Files Attached Files

  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 2406
    Posts
    44,662

    Re: VLOOKUP query

    two problems for the price of 1...

    Firstly, the range of the lookup should run from A (not from C) in your does not work example.

    Secondly, there are loads of tailing spaces after N2010 in the ESS sheet in the "does not work" W/B. These are not present in the "does work" W/B. You will need to get rid of them using CLEAN or TRIM.

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    Inverness
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: VLOOKUP query

    Thank you, Glenn. TRIM has solved the problem & got rid of the extra spaces - everything works now! (The range for the lookup did run from A, but I must have inadvertently changed it when I was tinkering with the spreadsheet to attach a sample.)

    Thanks again for your help.

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

    Re: VLOOKUP query

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ 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] Formula - adding an IF Query onto vlookup query
    By mra1984 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-06-2013, 05:31 AM
  2. Vlookup query
    By JSpeedy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2013, 04:54 AM
  3. VLookup Query
    By senan_g in forum Excel General
    Replies: 4
    Last Post: 10-18-2011, 11:48 AM
  4. vlookup in vba query
    By luffield in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2010, 07:23 PM
  5. VLOOKUP query
    By richpm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2007, 11:17 AM

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