+ Reply to Thread
Results 1 to 4 of 4

Lookup problems

  1. #1
    Forum Contributor
    Join Date
    03-16-2012
    Location
    Halifax, UK
    MS-Off Ver
    MS Office 365
    Posts
    206

    Lookup problems

    Hi
    I have inserted an Access Query that looks up from our database and puts the restricted data into a new sheet on my Excel file.

    On the main Input sheet I have a cell (I21) that I will enter an enquiry number into (e.g. 17000). The formula I have wont work and return #N/A in my cell I want the lookup answer in.
    These formulae work in other sheets and if I use =A2 and select the first cell in my query sheet.

    =IF(LOOKUP($I$21,Sheet2!$A$2:$A$50000,Sheet2!$B$2:$B$50000)="","",LOOKUP($I$21,Sheet2!$A$2:$A$50000,Sheet2!$B$2:$B$50000))

    =INDEX(Sheet2!A2:B5000,MATCH('Input Sheet'!I21,Sheet2!A2:A5000,0),2)

    I have sorted (ascending) the data in my 'A' column for the lookup and made the cells numbers (to 0 places).

    Any ideas what is wrong?

    Kieran

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Lookup problems

    Sounds like maybe I21 is a real number, but Sheet2!$A$2:$A$50000 are 'Numbers stored as text'
    Or Vice Versa

    Do either of these work? (really only concerned about the basic lookup, not the IF = "" test)

    =LOOKUP($I$21&"",Sheet2!$A$2:$A$50000,Sheet2!$B$2:$B$50000)
    =LOOKUP($I$21+0,Sheet2!$A$2:$A$50000,Sheet2!$B$2:$B$50000)

  3. #3
    Forum Contributor
    Join Date
    03-16-2012
    Location
    Halifax, UK
    MS-Off Ver
    MS Office 365
    Posts
    206

    Re: Lookup problems

    Thanks Jonmo1 the first formula worked!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Lookup problems

    You're welcome.

    Keep in mind that was really only troubleshooting. And you have what is called a 'Workaround', not a solution.

    You'd be better off in the long run correcting the cause of the problem.
    Which is that the 'numbers' in Sheet2!$A$2:$A$50000 are not really numbers. They're TEXT strings that look like numbers. AKA 'Number Stored As Text'.

    Try copying a blank empty cell.
    Highlight that column A on Sheet2
    Right Click - Paste Special - Values - Add.

    Now your original formula should work as expected.

+ 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] Problems with lookup
    By rookie37 in forum Excel General
    Replies: 4
    Last Post: 07-28-2014, 09:27 PM
  2. Problems with Lookup
    By Cmorgan in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-04-2014, 05:28 PM
  3. Problems with V lookup
    By barrelbowl in forum Excel General
    Replies: 1
    Last Post: 05-10-2012, 03:09 PM
  4. Excel 2007 : Problems With Lookup
    By suaun07 in forum Excel General
    Replies: 6
    Last Post: 03-12-2012, 07:49 AM
  5. lookup problems
    By oran828 in forum Excel General
    Replies: 8
    Last Post: 02-17-2009, 06:51 AM
  6. [SOLVED] Lookup problems
    By cvach in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2006, 04:55 PM
  7. lookup problems
    By nrussell in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 05-31-2005, 08:14 AM

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