+ Reply to Thread
Results 1 to 5 of 5

Look up across columns by Date Range and Return multiple matches

  1. #1
    Registered User
    Join Date
    03-25-2020
    Location
    raleigh, nc
    MS-Off Ver
    Office 365 ProPlus
    Posts
    2

    Look up across columns by Date Range and Return multiple matches

    Hi all! I am stumped on how to write an array to return a list of matches.

    sheet1 A1 is Headers D1-M1 Generated Dates from Original Date + Interval
    A1client (header) B1 interval (header) C1 original Date D1 Date E1 Date 1 F1 Date 2 and so on thru M1
    A2client a 14 1/1/2020 1/15/2020 1/29/2020 2/12/2020
    A3client b 28 1/1/2019 1/29/2019 2/26/2019 3/02/2019
    A2client c 14 1/1/2020 1/15/2020 1/29/2020 2/12/2020
    A3client d 28 1/1/2019 1/29/2019 2/26/2019 3/02/2019
    A2client e 14 1/1/2020 1/15/2020 1/29/2020 2/12/2020
    A3client f 28 1/1/2019 1/29/2019 2/26/2019 3/02/2019



    I want to return a client list where the match is on a start date and end date range specified on sheet 2
    A1 Start Date B1 End Date
    1/15/2020 1/30/2020


    List Returned:
    client a 14
    client c 14
    client e 14
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Look up across columns by Date Range and Return multiple matches

    =iferror(index($a$1:$a$7,aggregate(15,6,row($a$2:$a$7)/(($c$2:$l$7>=$c$9)*(mod(column($c$2:$l$7),2)=1))/(($d$2:$m$7<=$d$9)*(mod(column($d$2:$m$7),2)=0)),rows($a$9:a9))),"")

  3. #3
    Registered User
    Join Date
    03-25-2020
    Location
    raleigh, nc
    MS-Off Ver
    Office 365 ProPlus
    Posts
    2

    Re: Look up across columns by Date Range and Return multiple matches

    Thanks for responding Tim!

    I'm not seeing any results when I pasted this formula. Any chance you can use my spreadsheet attached and send back?

    Best,
    Amanda

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Look up across columns by Date Range and Return multiple matches

    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$7)/(MOD(COLUMN($C$2:$L$7),2)=1)/(($C$2:$L$7+$B$2:$B$7>$D$9)*$D$9+($C$2:$L$7+$B$2:$B$7)*($C$2:$L$7+$B$2:$B$7<=$D$9)-($C$2:$L$7>$C$9)*$C$2:$L$7-($C$2:$L$7<=$C$9)*$C$9>0),ROWS($A$9:A9))),"")
    the above formula takes into acount part range crosses

    btw AGGREGATE doesn't work with IF
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Look up across columns by Date Range and Return multiple matches

    Hi alehouse and welcome to the forum,

    If you were to gather your data differently a Pivot Table (no formulas needed) could do your problem. See the attached where I've Unpivoted your data to show you what I mean. After converting the data I did a pivot table with the dates as columns. If you FILTER those dates using the Date Filter and the BETWEEN calendars it leaves what you want. If you have lots more data, unpivoting your data is only a few mouse clicks away.
    Unpivot then Pivot Date Between in Columns.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Formula to return multiple matches within a range, ranked
    By chococ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-25-2016, 07:52 AM
  2. Replies: 9
    Last Post: 10-08-2015, 01:50 PM
  3. Return multiple columns with vlookup when there are multiple matches
    By elapo21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2013, 07:11 PM
  4. Replies: 10
    Last Post: 02-19-2013, 12:05 PM
  5. Replies: 0
    Last Post: 08-14-2012, 01:18 PM
  6. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 AM
  7. VLOOKUP return multiple matches in columns
    By Gracie789 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2008, 07:38 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