+ Reply to Thread
Results 1 to 5 of 5

vLOOKUP Issues

  1. #1
    Registered User
    Join Date
    08-24-2012
    Location
    Seattle, WA
    MS-Off Ver
    Office 2013
    Posts
    55

    vLOOKUP Issues

    I am trying to run a vLOOKUP formula across 2 tabs to pull relevant inventory date information. For the majority of the formula's / inventory date items, the formula works fine. However, some of them are not pulling the correct date. I do not know why, only noticed by spot-checking a few cells.

    Was hoping I could get some help on this. Is my formula wrong? Should there be an exact text instead of a number or something else?

    Please see attached spreadsheet...specifically, rows 141, 906, and 916 on the 'Dates' tab, and also the respectively accompanying rows 140, 275, and 285 on the 'Output' tab. let me know if you have any questions.

    Thanks

    Dom
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: vLOOKUP Issues

    Most of your Unique Identifiers in the Dates sheet have spaces after them, so it is difficult to get an exact match, especially as some of them are proper numbers.

    You can try this in G4 of your dates sheet:

    =IFERROR(VLOOKUP(A4&"*",Dates!B:G,6,0),IFERROR(VLOOKUP(A4,Dates!B:G,6),""))

    which will rectify those particular problems, as it will carry out an exact match and then an inexact match.

    Hope this helps.

    Pete
    Last edited by Pete_UK; 06-18-2013 at 08:50 PM.

  3. #3
    Registered User
    Join Date
    08-24-2012
    Location
    Seattle, WA
    MS-Off Ver
    Office 2013
    Posts
    55

    Re: vLOOKUP Issues

    I see, thanks Pete! Formula works great. Never knew one small space could be such a headache either.

    If you dont mind me asking, I had a few questions concerning the above formula:

    1 - Why do you have to use an 'IFERROR' formula here and why then must it be used twice? Is this just to help the user see if formula is wrong?
    2 - What does the "*" do? Not familiar with that formula syntax or whatever it is exactly.
    3 - Is the "0" following the "6" to find an exact match? Please correct me if I am wrong.

    I also placed the formula in the 'Output' tab and it worked just as well. Thanks again for your time and assistance.

    Dom

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: vLOOKUP Issues

    Hi Dom,

    glad to hear that it worked for you. In answer to your questions:

    1. When I was testing it, I accidentally put a comma after the 6 in the second VLOOKUP (which actually made it virtually the same as first), and that started to produce errors, so before I spotted the comma I wrapped a second IFERROR around that part. I saw and removed the comma while posting my response to you, and forgot to remove the inner IFERROR, so you could probably achieve the same thing by doing this (not tested):

    =IFERROR(VLOOKUP(A4&"*",Dates!B:G,6,0),VLOOKUP(A4,Dates!B:G,6))

    2. The asterisk is the wildcard character, meaning any number of characters, so the first VLOOKUP is trying to match with textual numbers which begin with the value in A4 (also a textual number) and any number of other characters (i.e. spaces).

    3. Yes, putting a zero as the 4th parameter in VLOOKUP means to carry out an exact match.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    08-24-2012
    Location
    Seattle, WA
    MS-Off Ver
    Office 2013
    Posts
    55

    Re: vLOOKUP Issues

    Got it, except #2.

    What do you mean by 'The asterisk is the wildcard character, meaning any number of characters,'?

+ 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