+ Reply to Thread
Results 1 to 3 of 3

Using Vlookup on trim function error need help ASAP

  1. #1
    Registered User
    Join Date
    St. Louis, MO
    MS-Off Ver
    Excel 2007

    Using Vlookup on trim function error need help ASAP

    A little back history, I'm taking 3 very different reports and consolidating them into one manageable readable form. Only problem is that no 1 report has the same info. I've created a key to help my form pick up the same information that is read differently. As my spreadsheet grows so do the formula issues. I've had one report that has been the biggest pain to break apart. It takes several things and consolidates them, ex: big 2014 girl - dog 20145

    I'm using a trim formula to read the last 5 digits that is the only consistent part of the string. =right(J3,5) to trim what i need to read (20145). this formula works. I'm than trying to preform a Vlookup based on what is returned from the trim. The trim number is located in a separate tab as the "key" 20145 = golden Labradors. formula for vlookup that works by itself, but throws up a blank cell when i point it to the trim cell. =iferror(vlookup($A2,Info!A:ZZ,2,False)" ")

    $A2 = the info 20145 from the trim
    Info! = is the tab with my 20145 = golden Labradors
    A:ZZ = the range in which i need it to find 20145
    2 = the second column where it should find 20145 = golden Labradors
    False = exact match.

    Please someone tell me why my formulas work separately but not when used together? The Vlookup will work if I type in the number 20145. I don't want to type 20145 anymore. I want to use the trim and have the vlookup notice the number pulled from the trim. Please help

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    YK, Indonesia
    MS-Off Ver
    Excel 2019

    Re: Using Vlookup on trim function error need help ASAP

    Maybe you'll get fast response when you decribe ptoblem with sample workbook, try to upload it at the forum.

    Click "Go Advanced" button and them find "Paperclip" to attach your file....


  3. #3
    Administrator FDibbins's Avatar
    Join Date
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)

    Re: Using Vlookup on trim function error need help ASAP

    Hi and welcome to the forum

    1st, when using a vlookup() try and avoid using full column references, it could slow things down. Rather, use a range that is closer to what your data is A1:B1000 etc
    2nd, if you are only looking in the 2nd column, you dont need to go out to column ZZ

    3rd, if what you are searching for is actually a number/value, then you need to convert your =RiGHT() to a value. LEFT/RIGHT/MID always return a string answer, even if it looks like a value. So maybe try this...
    =iferror(vlookup($A2*1,Info!A1:B1000,2,False)" ")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you


+ 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, got N/A error even using TRIM
    By sand takagi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-22-2013, 10:25 PM
  2. [SOLVED] Vlookup doesn't work - even with TRIM function
    By piper_co in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-08-2013, 08:07 AM
  3. Trying to trim a trailing space char and the Trim function isn't working
    By Psychochook in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2007, 11:28 PM
  4. vlookup with trim function
    By rodgie in forum Excel General
    Replies: 4
    Last Post: 06-06-2006, 07:02 AM
  5. Replies: 3
    Last Post: 12-29-2005, 11:10 PM


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