+ Reply to Thread
Results 1 to 4 of 4

Formula error - data validation + HLOOKUP returns #N/A

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Florida, US
    MS-Off Ver
    Excel 2007
    Posts
    3

    Formula error - data validation + HLOOKUP returns #N/A

    Simple pricing sheet for copier services.
    Page sizes and pricing listed in grid at top. (Paper sizes formatted as text, pricing formatted as Currency.)
    User enters data line in lower grid.
    Data entry 'Paper Size' (column E) is Data Validation drop down - linked to grid at top.
    Select 'Paper Size' and enter number value (column F). Cost calculates based on HLOOKUP in top grid using Data Validation value from 'Paper Size'.
    =IF(F6="",0,(F6*HLOOKUP(E6,$C$2:$E$3,2)))

    Works for all grid values (C2 - E2) except if value = "11x17". Select value "11x17" and results = #N/A.
    Change value "11x17" to anything else not starting with "11", re-enter the data line, and calculation works. File attached.
    Used Evaluate Formula - validation value is reading as text ("..") and grid values are formatted as text. Confirmed with =TYPE(). Tried E2 = '11x17 and = "11x17". No effect.

    Change cell E2 value = "11x17" (E2) to ANYTHING else not starting with "11" and it works. But fails for E2 value = "11x17". Why?
    Attached Files Attached Files
    Silly questions are cheaper than mistakes

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Formula error - data validation + HLOOKUP returns #N/A

    HLOOKUP requires the values to be in alphabetical order.
    Re-sort the table into alphabetic order and it works.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Formula error - data validation + HLOOKUP returns #N/A

    Try this.....

    Please Login or Register  to view this content.
    Use range_lookup as Exact Match which is False or 0 in the Hloopup formula.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    07-01-2014
    Location
    Florida, US
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Formula error - data validation + HLOOKUP returns #N/A

    Thank you. Well I feel silly. Did not see the order was not properly sorted.
    I usually avoid using V/HLOOKUP formulas for that very reason. (Prefer INDEX/MATCH.)

+ 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. Formula Error returns with Name#? only within a certain data set
    By Jgreenlee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2013, 10:46 PM
  2. Replies: 6
    Last Post: 06-11-2013, 08:32 PM
  3. Run HLOOKUP macro on outcome of Data Validation
    By simonc64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 09:36 AM
  4. Formula Error and Data Validation Help
    By 1.zer0 in forum Excel General
    Replies: 10
    Last Post: 04-30-2010, 04:44 PM
  5. Excel 2007 : HLOOKUP with data validation lists ??
    By bradley2012 in forum Excel General
    Replies: 1
    Last Post: 05-01-2009, 08:53 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