+ Reply to Thread
Results 1 to 8 of 8

lookup function

  1. #1
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    lookup function

    Hi!

    I am using LOOKUP Function.
    When this function can't find the data, it returns NA(). Now, I want that it returns empty cell (i.e. "") if it can't find the data. I tried with this:

    Please Login or Register  to view this content.
    but it still doesn't return EmptyCell but again #NA().

    Is there another way to solve this problem?

    Thanks in advance
    Last edited by cassiopea; 02-18-2011 at 07:31 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: lookup function

    Checkout,
    =if(iserror()
    Check out this explaination
    http://spreadsheetpage.com/index.php...s_in_formulas/

  3. #3
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: lookup function

    It's probably returning an NA() error because the value in O3 is less than the value in J2 (assume J2:J10 is sorted). If that's right then:
    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  4. #4
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: lookup function

    Daves solution works just fine, but another problem appeared.

    If a lookup_vector contains an error (NA()), then Lookup function returns an error too (#NAME) although there is a match value in lookup vector. I tried to name (define) lookup vector, but it still returns the error. Is there a solution?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: lookup function

    Underlying errors in the lookup_vector will not cause the LOOKUP to fail per se - this feature is in fact one if it's main advantages

    Underlying errors in the result_vector, however, would generate the same error value should the error be the appropriate result for the LOOKUP (based on lookup_vector match)

    In your formula non numerics in the result_vector would generate #VALUE! errors given the explicit coercion taking place thereafter.

    Perhaps you could post a sample which illustrates the problem "in action"

  6. #6
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: lookup function

    ok, now I have errors in result_ vector and LOOKUP returns an error although there is no error in lookup_vector nor in the match in the resulz_vector.

    I attached an example.
    Attached Files Attached Files

  7. #7
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: lookup function

    The issue is that the formulae in column D mean that the dates are not sorted. LOOKUP() relies on this.

    If you change the formula in D4 to this and fill down you should be OK
    Please Login or Register  to view this content.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: lookup function

    In addition to Colin's points above... if you want to perform an exact match on the date consider using a VLOOKUP with range_lookup of FALSE else use SUMIF.

+ 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