+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP Returning #NA

  1. #1
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    VLOOKUP Returning #NA

    Hello,

    I have used VLOOKUP a fair amount but I am stumped why I keep on getting #NA.

    I have checked if additional text is in a string -- hence I used the TRIM function to clean it

    Does anyone have any ideas? I have attached the data for your reference. I am looking to return the state in column G (CMS Bundled Payment Data Tab) based on the city being present in both tables.

    Any help, much appreciated.

    All the best,
    Adam
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: VLOOKUP Returning #NA

    Quite a few problems with your formula there, Adam.

    Firstly, the lookup reference is off by 1 row (formula in row 2 is trying to find the header in A1)
    Secondly, the table reference is not anchored, thus resulting the the reference to that table moving along as you copy it down.
    Third, the column number value of 4 is incorrect as the table only contains 2 columns worth of data (I suspect its from you deleting some columns to preserve confidentiality)
    Lastly, the table should be structured differently. The first column of the table should be the cities (as you are trying to find them) and the 2nd column should be the states.

    I've swapped the columns in US States & Cities around and changed the formula in G2 to
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It should work now. See attached.
    Attached Files Attached Files

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

    Re: VLOOKUP Returning #NA

    Try it like this in G2:

    =IFERROR(INDEX('US States & Cities'!A:A,MATCH(A2,'US States & Cities'!B:B,FALSE)),"not found")

    then copy down.

    Hope this helps.

    Pete
    Last edited by Pete_UK; 07-22-2015 at 08:19 PM.

  4. #4
    Forum Contributor
    Join Date
    01-17-2012
    Location
    Canada
    MS-Off Ver
    Excel 365
    Posts
    221

    Re: VLOOKUP Returning #NA

    Hi Adam - try using this instead....paste in cell G2 of "CMS Bundled)"

    =INDEX('US States & Cities'!$A$2:$A$29471,MATCH('CMS Bundled Payment Data'!A2,'US States & Cities'!$B$2:$B$29471,0))

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,415

    Re: VLOOKUP Returning #NA

    You need to use INDEX/MATCH for this, not VLOOKUP. With VLOOKUP the column to be searched MUST be on the left.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: VLOOKUP Returning #NA

    Hi,

    Thank you so much! Yes, I deleted some columns to preserve confidentiality.

    Thanks for pointing out my mistake!

    All the best,
    Adam

  7. #7
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: VLOOKUP Returning #NA

    Thanks to all for all your feedback.

    Much appreciated!!

    - Adam

+ 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. Using vLookup based on results from a vLookup & returning an undetermined list
    By NormalityBan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-14-2014, 05:02 AM
  2. Vlookup - not returning #N/A
    By rofl in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-21-2007, 06:38 AM
  3. vlookup returning a #N/A value
    By Ian in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-17-2006, 10:10 AM
  4. vlookup returning sum
    By Trevor Shuttleworth in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 03:05 PM
  5. [SOLVED] vlookup returning sum
    By Rose in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. [SOLVED] vlookup returning sum
    By Rose in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. vlookup returning sum
    By Rose in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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