+ Reply to Thread
Results 1 to 5 of 5

XLOOKUP not finding result

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    693

    XLOOKUP not finding result

    Hi, what am I missing in the attached that XLOOKUP fails in one instance?

    If I solved all the ranges into array constants, it seems to work.

    Thx
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,390

    Re: XLOOKUP not finding result

    It looks like floating point error. If I enter =(B3-D1) [note the parentheses that are needed to prevent Excel from arbitrarily deciding that this difference should be exactly 0] into a cell and format as scientific, I get 2E-9, indicating a very small difference between the two values.

    Most of the time, floating point errors are handled using ROUND() functions. In your example, it appears that all numbers are integers, so perhaps rounding the values in column D to integers would be suitable =ROUND(currentformula,0) in D1 and D2.

    The other solution might be to consider what the repeated division/reciprocal is supposed to be doing and try a different operation, since the floating point error is going to be introduced by the division/reciprocal operation.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    693

    Re: XLOOKUP not finding result

    Thx.
    The repeated division is a necessary data cleaning exercise required in the full data set.

    I noted that e.g. switching to filter to achieve a similar result does not exhibit the same problem, at least not in this instance.
    Not exactly sure though why that is.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,390

    Re: XLOOKUP not finding result

    The main difference I see between a filter operation and a 1/(1/n) operation is that a filter merely extracts the data according to criteria, but performs no operations on the data. 1/(1/n) actually operates on the data. Because 1/n cannot be exactly represented in floating point notation but must be approximated, the overall 1/(1/n) operation may or not be exactly equal to the original value n.

    Data cleaning is not something I do much of, so I cannot really speak to best practices. It seems to me that, all else being equal, a cleaning operation that avoids introducing floating point errors will be superior to an operation that does. Since all else is rarely equal, one usually needs to make some kind of decision based on the overall goals of the task and what options one has for accomplishing the task.

    If you are unfamiliar with floating point arithmetic, this is still the most complete document I have found (even though it is 30+ years old): https://docs.oracle.com/cd/E19957-01..._goldberg.html There's almost certainly more there than you want to know, but, if you can get through the first few sections, you will be well on your way to understanding why 1/(1/n) <> n (at least sometimes).

  5. #5
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    693

    Re: XLOOKUP not finding result

    Apologies, I wasn't clear with my answer.
    I meant I used FILTER instead of XLOOKUP (not instead of 1/1/) and working with the 1/1/-number semeed to be no problem for FILTER.
    =FILTER(A3:A4,D1:D2=B3)
    I had suspected floating point issues, but there didn't appear one to be to me (I see the issue when I use your formula though =(B3-D1)).
    When I solve cell D1 with F9, XLOOKUP works.
    However, when I paste cell D1 as a value, there's still a problem despite the number doesn't appear to have an issue.

    I agree with the rest of your comments. Thanks for your explanation.

+ 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. Xlookup Dates not Finding Each other. Keep getting #Value!
    By ayns123 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2025, 03:12 PM
  2. [SOLVED] Show left chars of xlookup result with conditions on return result
    By Tech980 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2023, 07:15 AM
  3. [SOLVED] Xlookup not Showing Result
    By JennOlsen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2023, 06:33 PM
  4. How to display 0.000 in the result of a XLOOKUP formula
    By punksterz626 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-25-2023, 03:03 PM
  5. Xlookup formula to get result from different worksheet
    By Aland2929 in forum Excel General
    Replies: 6
    Last Post: 04-21-2023, 04:15 PM
  6. [SOLVED] trying to use xlookup to get the result of looking at 2 columns
    By gjjh25 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-30-2022, 08:19 AM
  7. Finding Duplicate Values with Xlookup
    By aksaunders in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2021, 10:14 PM

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