+ Reply to Thread
Results 1 to 6 of 6

XLOOKUP when there are blanks in the data

  1. #1
    Forum Contributor Webbers's Avatar
    Join Date
    09-06-2005
    Location
    Poinciana, FL
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    337

    XLOOKUP when there are blanks in the data

    I have an issue. I am using XLOOKUP (love it!!!!), and the fourth argument for the Errors works great. But if there is a BLANK in the data, then in this example for the number of customers, a 0 appears. I would like a "-" to appear, just like I have set for my errors. This works properly in my example for Net Sales and the Profit / Loss, which are in Accounting format rather than whole numbers.

    Much of the data I work with includes blank cells, and I require a way to pull the data in, and suppress the 0s. There may be settings within Excel to change, however this is not an option, as these reports are sent to many people and done on a regular basis, so I cannot have all these people adjust their settings too.

    I have attached a sample workbook, the salesmen is a dropdown, and the last 2 people in the table just joined the team in this example, and do not yet have active sales. Thanks in advance!
    Attached Files Attached Files
    ~*~ Sherry ~*~
    Poinciana, FL

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: XLOOKUP when there are blanks in the data

    How about this?

    =IFERROR(1/(1/XLOOKUP($H$3,sales[Sales Person],sales[No. Customers])),"-")
    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 Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: XLOOKUP when there are blanks in the data

    Please try

    =LET(a,XLOOKUP($H$3,sales[Sales Person],sales[[No. Customers]:[Profit / Loss]]),TRANSPOSE(IF(a="","",a)))

    or
    =TRANSPOSE(IF(XLOOKUP($H$3,sales[Sales Person],sales[[No. Customers]:[Profit / Loss]])="","",XLOOKUP($H$3,sales[Sales Person],sales[[No. Customers]:[Profit / Loss]])))
    Attached Files Attached Files

  4. #4
    Forum Contributor Webbers's Avatar
    Join Date
    09-06-2005
    Location
    Poinciana, FL
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    337

    Re: XLOOKUP when there are blanks in the data

    AliGW,

    Perfect!!!!! Thanks so much! With all the information available on XLOOKUP, and the 4th argument to avoid the dreaded IF statement, you would think this little gem would be included too. I am adding this to my notes, as I know I will need it again soon. Thanks again!

  5. #5
    Forum Contributor Webbers's Avatar
    Join Date
    09-06-2005
    Location
    Poinciana, FL
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    337

    Re: XLOOKUP when there are blanks in the data

    Bo_Ry,

    I did not try your suggestion, as Ali's worked. But I wanted to thank you for your quick response to my problem.

  6. #6
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: XLOOKUP when there are blanks in the data

    Thanks for the rep.

+ 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. Two-way Xlookup
    By Ballet4ever in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2021, 10:11 PM
  2. [SOLVED] Xlookup vs vlookup
    By Mr_Phil in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-03-2021, 03:19 PM
  3. [SOLVED] Xlookup with VBA, need some help!
    By CSimm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-19-2021, 03:14 PM
  4. XLOOKUP availability?
    By PeteABC123 in forum Excel General
    Replies: 8
    Last Post: 10-22-2020, 06:10 PM
  5. Xlookup & sum
    By lynusann in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2020, 11:04 PM
  6. Replies: 1
    Last Post: 05-27-2020, 12:20 AM
  7. [SOLVED] Access Query shows (Blanks) but no blanks in data!
    By MissDB in forum Access Tables & Databases
    Replies: 0
    Last Post: 09-08-2016, 07:16 AM

Tags for this Thread

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