+ Reply to Thread
Results 1 to 9 of 9

VLOOKUP Function not working properly

  1. #1
    Registered User
    Join Date
    06-07-2019
    Location
    Visalia, CA
    MS-Off Ver
    2016
    Posts
    2

    VLOOKUP Function not working properly

    Hello All,

    I would like some help with the VLOOKUP function....

    I am trying to use the VLOOKUP function in Excel to display the TOP Code of a course. In the TOP Code column in Sheet 1, I want to find a course that exists in Sheet 1 and Sheet 2, then display its corresponding TOP Code from Sheet 2 in Sheet 1.

    In the attached file, I made two VLOOKUP function formulas that do not seem to be working properly. The one next to "ACCT 001" omits TRUE/FALSE and therefore gives an incorrect TOP code of "0502.10* Tax Studies." It should be "0502.00* Accounting."

    In the second VLOOKUP function formula, I added FALSE to look up an exact match of "ACCT 002" in Sheet 2 but the result is a #N/A error.

    I also tried the following INDEX/MATCH function formula but it gave me similar incorrect results: =INDEX(Sheet2!B:B,MATCH(Sheet1!A6,Sheet2!A:A))

    I am not sure what I am doing wrong. Any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: VLOOKUP Function not working properly

    You need this:

    =VLOOKUP(A5,Sheet2!A$2:B$919,2,0)

    HOWEVER you need to fix the items that you are matching - they do not match. ACCT 001 looks the same in each list, but isn't - the space between the two parts of it is different, and if you paste this anywhere in Sheet 2 you will see that it returns FALSE:

    =A2=Sheet1!A5
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: VLOOKUP Function not working properly

    The problem comes from the values not equaling each other.

    To test, in I5 on Sheet1 use >> =A5=Sheet2!A2

    You will see this returns false. That means ACCT 001 in A5 does not equal ACCT 001 on Sheet2
    HTH
    Regards, Jeff

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: VLOOKUP Function not working properly

    On sheet 1 you have things like BUS 119, but on sheet2 it's BUS119 without the space

    Also on sheet 1 some of the spaces are non-breaking spaces, rather than normal spaces.
    To fix this use Ctrl H > in the Find what type Alt 0160 (you must use the numeric keypad, not the numbers on the main keyboard) > In Replace put a space > replace All

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: VLOOKUP Function not working properly

    Hi

    In sheet 1 you must change all code 160 by 32

    In Sheet 2 ACCT 001 has codes 65,67,67,84,32,48,48,49
    In Sheet 1 ACCT 001 has codes 65,67,67,84,160,48,48,49

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: VLOOKUP Function not working properly

    Also some of the value in col A on sheet2 have a space after them

  7. #7
    Registered User
    Join Date
    06-07-2019
    Location
    Visalia, CA
    MS-Off Ver
    2016
    Posts
    2

    Re: VLOOKUP Function not working properly

    Thank you so much to all who helped!

    ACCT 001 in both sheets seemed to match. Now that I know that the space in between caused them not to match I was able to replace all the spaces. I will also work on fixing the data in Sheet 2 to have proper spacing between the subject and the course number.

    This truly is going to save me a tremendous amount of time and effort. Thanks again and have a great day. This is an awesome forum!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: VLOOKUP Function not working properly

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: VLOOKUP Function not working properly

    You're welcome & thanks for the feedback

+ 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 not working properly
    By theTaoJones in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-31-2017, 04:01 PM
  2. [SOLVED] Vlookup Not working Properly
    By josepfh in forum Excel General
    Replies: 16
    Last Post: 04-20-2017, 12:18 PM
  3. VLOOKUP Not Working Properly
    By Cremorneguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2014, 03:09 PM
  4. vlookup not working properly
    By moley165 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-10-2013, 05:03 AM
  5. VLOOKUP not properly working
    By amphinomos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2013, 05:35 AM
  6. [SOLVED] vlookup not working properly
    By djmatok in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-25-2013, 12:19 PM
  7. vlookup function not working properly
    By carlosgdlf in forum Excel General
    Replies: 1
    Last Post: 03-05-2009, 03:24 AM

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