+ Reply to Thread
Results 1 to 6 of 6

Xlookup not working as expected

  1. #1
    Forum Contributor
    Join Date
    04-02-2019
    Location
    Ottawa,Ontario
    MS-Off Ver
    365
    Posts
    180

    Xlookup not working as expected

    In the attachment I have a simple table. In column "F" I've taken the last digit from the numbers in column "B".

    My goal in Column "G" is to match the number in column "F" with column "I" and place the name from Column J but for some reason I keep getting #N/A error.

    Any help would be appreciated .

    Ron
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,380

    Re: Xlookup not working as expected

    Apples and pears, or more precisely, text and numbers - they aren't the same!

    =XLOOKUP(--F2,I1:I10,J1:J10)

    and fix the ranges:

    =XLOOKUP(--F2,$I$1:$I$10,$J$1:$J$10)
    Attached Files Attached Files
    Last edited by AliGW; 08-24-2023 at 09:41 AM. Reason: Workbook added.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,380

    Re: Xlookup not working as expected

    Glad to have helped.

    Just to wrap up: the RIGHT function will return text.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks for the rep.

  4. #4
    Forum Contributor
    Join Date
    04-02-2019
    Location
    Ottawa,Ontario
    MS-Off Ver
    365
    Posts
    180

    Re: Xlookup not working as expected

    Thank You, I thought I had responded but guess not. Your help was bang on for what I needed.

    What is the "--" meant for ? I've never seen this used before.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,380

    Re: Xlookup not working as expected

    It turns a number stored as text into a real number. The RIGHT function returns text.

    You could add the -- to your RIGHT function instead of the XLOOKUP if you preferred.

  6. #6
    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
    45,118

    Re: Xlookup not working as expected

    The double negative coerces the text "number" into a true numeric value. It is, effectively, carrying out two numeric operations on the text value. That is, -1 * -1 * text number = numeric value. There are other ways of coercing the value. You can add or subtract zero ( 0 ), or multiply by one ( 1 ).

    You can avoid the helper column:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


+ 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] XLOOKUP partial criteria formula not working
    By thematrix05 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-25-2023, 01:28 AM
  2. [SOLVED] XLOOKUP not working when formula searches on different sheet
    By Calb1976 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2023, 03:12 AM
  3. XLookup Max not working in VBA
    By Dylan1023 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2023, 07:49 PM
  4. Replies: 6
    Last Post: 03-11-2023, 10:13 AM
  5. XLOOKUP not working as well with sharepoint files
    By twaccess in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-28-2021, 05:31 AM
  6. [SOLVED] Mutil-critieria XLookUp with range is concacted together - not working
    By stearno in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2020, 06:29 AM
  7. SUM IF not working as expected
    By koalamotorsport in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-28-2019, 11:42 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