+ Reply to Thread
Results 1 to 4 of 4

Using Xlookup while avoiding blanks to instead return adjacent column

  1. #1
    Registered User
    Join Date
    10-17-2018
    Location
    Plymouth
    MS-Off Ver
    Excel 2021
    Posts
    96

    Using Xlookup while avoiding blanks to instead return adjacent column

    Hi.

    I would like to use XLookup to return a date from a table on Sheet 2 based on an ID entered into the table on Sheet 1. The issue is that the dates populate two different columns and must remain that way. If the Date 1 column is blank I would like xlookup to pull the data from the Date 2 column instead. The attached sheet will demonstrate the requirement.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    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
    44,086

    Re: Using Xlookup while avoiding blanks to instead return adjacent column

    One way:
    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


  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Using Xlookup while avoiding blanks to instead return adjacent column

    Please try

    =MAX(XLOOKUP(A3,Table1[ID],Table1[[Date1]:[Date 2]],))
    Attached Files Attached Files

  4. #4
    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
    44,086

    Re: Using Xlookup while avoiding blanks to instead return adjacent column

    Thanks for the rep.


    Have to say, Bo_Ry's formula is much neater.

+ 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 to return cell based on multiple criteria in single column
    By mikehay08 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-24-2021, 02:59 PM
  2. [SOLVED] XLOOKUP when there are blanks in the data
    By Webbers in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-13-2021, 01:28 PM
  3. [SOLVED] Copy non-adjacent cells, paste without blanks (based on only one column)
    By LukeNZ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2018, 11:13 AM
  4. [SOLVED] Unable to create macro that pastes values from one column to adjacent blanks
    By lcgar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-28-2016, 11:58 AM
  5. Replies: 2
    Last Post: 09-01-2016, 12:14 AM
  6. Copy cells to adjacent column, removing blanks
    By jbitluk in forum Excel General
    Replies: 8
    Last Post: 12-11-2009, 03:14 PM
  7. Sumproduct - Avoiding blanks
    By jpruffle in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-18-2008, 04:03 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