+ Reply to Thread
Results 1 to 6 of 6

Using XLOOKUP to return multiple (variable) rows

  1. #1
    Registered User
    Join Date
    03-10-2022
    Location
    NZ
    MS-Off Ver
    365
    Posts
    14

    Question Using XLOOKUP to return multiple (variable) rows

    Hi

    We have a spreadsheet which records many data on separate tabs. The workbook is typically used for a year, so there are a few thousand rows overall. We extract some of these data onto a daily printout of salient information. The current formula finds the date specified in the list of data from a different tab, and returns as many entries as there are for that date. I find the current formula (based on old Excel) difficult to troubleshoot and correct when there is an error. I can easily create an XLOOKUP formula to pick up the data from the first row we need, but I'm struggling to see how to get the other rows to display.

    Tab name of the other tab is "CIP". On the Daily Report tab, the date of the report required is in cell N2.

    Old formula:

    =IF(ISERROR(INDEX(CIP!$C$6:$P$63847,SMALL(IF($N$2=CIP!$M$6:$M$63849,ROW(CIP!$C$6:$P$63847)-MIN(ROW(CIP!$C$6:$P$63847))+1,""),ROW(CIP!A1)),COLUMN(CIP!A1))),"",INDEX(CIP!$C$6:$P$63847,SMALL(IF($N$2=CIP!$M$6:$M$63849,ROW(CIP!$C$6:$P$63847)-MIN(ROW(CIP!$C$6:$P$63847))+1,""),ROW(CIP!A1)),COLUMN(CIP!A1)))

    New XLOOKUP formula which collects the relevant info - only for the first row! - and spills the other columns:
    =XLOOKUP($N$2,CIP!$M$6:$M$63847,CIP!$C$6:$N$63847,"",0,1)

    From reading help files, it seems I can use an array formula to look up an nth value, but each day there will be a different number of entries (rows). If there are none, the ISERROR returns a result of "", and I'd like to update this to IFERROR at the same time.

    Unfortunately I'm not very good at structuring complex formulas and I end up getting tangled. Can anyone give me a formula for this? First screenshot is the daily report showing the CIP information captured on the report using the old formula. Second screenshot shows the data from CIP tab with 10 entries on 1st Dec; 12 entries for 2nd Dec; 0 entries for 3rd Dec...

    Screenshot 2022-12-08 170447.jpg
    Screenshot 2022-12-08 170806.jpg

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Using XLOOKUP to return multiple (variable) rows

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-10-2022
    Location
    NZ
    MS-Off Ver
    365
    Posts
    14

    Re: Using XLOOKUP to return multiple (variable) rows

    Really? Is this the quality of service for people who have genuine queries, and who provide all relevant information, clearly identified and clearly articulated with clear pictures - that a moderator tells me off? Perhaps you should rethink your service model. The yellow banner at the top of the page doesn't say this is compulsory, it states "Fast answers need clear examples." I have provided VERY CLEAR information. What extra information would an empty spreadsheet provide you? If you are an expert in formulas, (which is, afterall why I submitted to the forum), you have all the information you need.

    Very disappointed in this response.

  4. #4
    Registered User
    Join Date
    03-10-2022
    Location
    NZ
    MS-Off Ver
    365
    Posts
    14

    Re: Using XLOOKUP to return multiple (variable) rows

    In fact, you know what? Earlier in the year I submitted a post with a screenshot and clear description and it was answered just fine, but now your complete lack of customer service has annoyed me so much that I'm quitting the forum.

    None of my recent posts have given me any answers. I've been told by a Forum Guru "Do this" when in my original post I clearly say "I've already done this and it didn't work", and he went on to tell me "It must be a SharePoint issue" when I've already clearly said it isn't a SharePoint issue because I have other workbooks saved in SharePoint where I can do this task.

    I've been told by a Valued Forum Contributor that "It doesn't work because of..." and I already know it doesn't work, which is why I'm asking on the forum how to get it to work. But she didn't give me any help at all.

    So, a Moderator, a Forum Guru and a Valued Forum Contributor all gave me exactly ZERO help - why should I stick around? There is a much better community at 'techcommunity.microsoft.com/t5/microsoft-excel/ct-p/Excel_Cat' where people read my post, give help, and I don't get told off from a moderator for not completing an optional step.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Using XLOOKUP to return multiple (variable) rows

    TomPeregrinNZ

    1.) This forum is manned by volunteers ... in the above case a very senior member and Moderator. He works for free.
    2.) You are not a customer. You are a member.
    3.) You are expected to do the bulk of the work. It is after all your problem. A simple upload saves volunteers from having to retype data you clearly already have. That is just common courtesy. We have a rule for that.
    4.) If you still feel your needs are best served elsewhere you are free to do so.

    FlameRetired
    Dave

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Using XLOOKUP to return multiple (variable) rows

    You do not employ me.

    You do not pay me.

    If you expect me to recreate what YOU already have in front of you, you are VERY much mistaken.

    I do this for fun and provide a "service" to no man.

    Your attitude is grossly arrogant amd offensive.

    Just who in Hades do you think you are?

    Goodbye.
    Last edited by Glenn Kennedy; 12-09-2022 at 04:10 AM.

+ 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 Does Not Work With Text-based As Lookup Variable
    By SweetBaboo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2022, 01:56 PM
  2. [SOLVED] XLOOKUP with multiple search criteria and multiple return values
    By Cuni in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 10-26-2022, 09:27 AM
  3. [SOLVED] Multiple XLOOKUP/INDEX(MATCH) functions to return one value.
    By AaronIsNerd in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-11-2022, 06:57 AM
  4. [SOLVED] Query on using XLOOKUP to return a value just once
    By Majestic1976 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-09-2021, 11:33 AM
  5. Xlookup return maximum value for multiple criteria
    By Excelforum2020 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-09-2021, 10:18 AM
  6. Xlookup variable to search for defined by slicer
    By PrimePorkchop in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-30-2021, 05:33 PM
  7. [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

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