+ Reply to Thread
Results 1 to 6 of 6

Vlookup doesn't work - even with TRIM function

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    4

    Vlookup doesn't work - even with TRIM function

    Hi

    I am having problems troubleshooting why vlookup doesn't work. Went through the forum and saw a thread that advised to use trim function to eliminate the spaces. Did that. But it works for some cells and doesn't work for some cells. Pls help.

    I have attached the file. Column D in tab "decision making" is showing #NA for some cells.

    Appreciate all help.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup doesn't work - even with TRIM function

    Hi Piper_co,

    Welcome to the forum.

    solution... where you have #N/A, dont use trim there

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached:- EXCEL ASSIGNMENT - CABLE TV V2.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Vlookup doesn't work - even with TRIM function

    hi piper_co, welcome to the forum. working in Starhub eh? a better way is to clean up your data & make sure both sheets are the same. the reason those cells dont work is because there are spaces in the "Add-Ons Channel" sheet. so another way to standardise is to trim both sides by using an array formula:
    =IF(C31="Yes",VLOOKUP(TRIM(B31),TRIM(Add_Ons_Channel_Listing),2,FALSE),0)+0
    press CTRL + SHIFT + ENTER to confirm instead of just ENTER>

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    01-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Vlookup doesn't work - even with TRIM function

    Quote Originally Posted by dilipandey View Post
    Hi Piper_co,

    Welcome to the forum.

    solution... where you have #N/A, dont use trim there

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached:- Attachment 204751

    Regards,
    DILIPandey
    <click on below * if this helps>
    Hi DILIPandey

    It doesn't work. I tried inputting the formula you mentioned, it doesn't seemed to work. I opened your attached amended file, it shows me #name in column D.

    Pls advise

    Thanks

  5. #5
    Registered User
    Join Date
    01-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Vlookup doesn't work - even with TRIM function

    Quote Originally Posted by benishiryo View Post
    hi piper_co, welcome to the forum. working in Starhub eh? a better way is to clean up your data & make sure both sheets are the same. the reason those cells dont work is because there are spaces in the "Add-Ons Channel" sheet. so another way to standardise is to trim both sides by using an array formula:
    =IF(C31="Yes",VLOOKUP(TRIM(B31),TRIM(Add_Ons_Channel_Listing),2,FALSE),0)+0
    press CTRL + SHIFT + ENTER to confirm instead of just ENTER>
    Hi benishiryo,

    Amazing!!! It works!! Cool! Nah I don't work there. It is a school assignment. But I would like to understand why there is this +0 at the end, what does it mean? and why "CTRL + SHIFT + ENTER to confirm instead of just ENTER" ? the formula turns out to look like this =IF(C31="Yes",VLOOKUP(TRIM(B31),TRIM(Add_Ons_Channel_Listing),2,FALSE),0)+0

    I would like to understand more. You're great! I'm still in shock it works!

    Thanks

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup doesn't work - even with TRIM function

    HI Piper,

    You received #NAME! error as you are using Excel 2003, below is the revised formula to work in 2003 version:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See rev attachment:- EXCEL ASSIGNMENT - CABLE TV V2.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Registered User
    Join Date
    01-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Vlookup doesn't work - even with TRIM function

    Quote Originally Posted by dilipandey View Post
    HI Piper,

    You received #NAME! error as you are using Excel 2003, below is the revised formula to work in 2003 version:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See rev attachment:- Attachment 204756

    Regards,
    DILIPandey
    <click on below * if this helps>
    Hi dilipandey,

    wow! This works too! Thanks so much! Not sure which formula is a better way to have consisitent vlookup values now.

    But really thanks to all!


  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup doesn't work - even with TRIM function

    you are welcome Piper..

    and its up to you which one you would like to use

    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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