+ Reply to Thread
Results 1 to 4 of 4

Returning array of dates based on date range

  1. #1
    Registered User
    Join Date
    10-24-2018
    Location
    Fort Worth, Texas
    MS-Off Ver
    Office 365
    Posts
    2

    Returning array of dates based on date range

    Hi all,

    I am new to using arrays and am having trouble with the following:

    I have a long list of dates and projects. I would like to create a table that returns details for a given week. An example of what I would like to return:

    Screen Shot 2018-10-31 at 3.27.41 PM.png

    The week to pull is manually entered in B3 and B4. Table 1 has all the projects listed. Table 2 should pull Dates greater than or equal to B3 and less than B4. It should also pull the corresponding Project to each date. As you can see, since there are multiple projects on various dates, I know I need to use an Index function rather than a Lookup function to pull all. I have a formula that only pulls projects from a single date:

    {=IFERROR(INDEX(Table_1[Project],SMALL(IF(Table_1[Date]=$B$3,ROW(Table_2[Project])-MIN(ROW(Table_2[Project]))+1),ROWS(F$7:F7))),"")}

    This formula is entered in F7. A similar formula is in E7 but with all instances of "Project" exchanged with "Date". This formula works fine.

    I tried this formula but it would only return the info in the first line of Table 1:

    {=IFERROR(INDEX(Table_1[Project],SMALL(IF(AND(Table_1[Date]>=$B$3,Table_1[Date]<$B$4),ROW(Table_2[Project])-MIN(ROW(Table_2[Project]))+1),ROWS(F$7:F7))),"")}

    After that I'm stuck. Any help would be appreciated.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Returning array of dates based on date range

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-24-2018
    Location
    Fort Worth, Texas
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Returning array of dates based on date range

    Hey Alan,

    Thanks for your help, I'm new to using these sorts of forums. After running the document by some people here I was able to figure out an alternative layout that is much simpler and a little easier to read. I guess I should have stuck to the KISS principle to begin with. Thanks.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Returning array of dates based on date range

    In E7 then dragdown.

    =IF($B$3+ROWS($E$7:$E7)-1<=$B$4,$B$3+ROWS($E$7:$E7)-1,"")

    In F7 then drag down

    =IFERROR(INDEX($C$7:$C$23,MATCH(E7,$B$7:$B$23,0)),"")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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. Returning a value based on date range
    By Chris.Williams81 in forum Excel General
    Replies: 6
    Last Post: 05-14-2015, 06:22 AM
  2. [SOLVED] Returning a date from a range if date falls between two other dates
    By sdavison in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-25-2013, 03:59 AM
  3. Returning a cell value based on a range of dates
    By Bianca1234567 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-17-2013, 05:13 AM
  4. [SOLVED] Returning a date based on a range of dates
    By ExcelAteMyHomework in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2012, 06:07 PM
  5. Vlookup Returning Values based on Date Range
    By kgibson20 in forum Excel General
    Replies: 5
    Last Post: 06-28-2012, 09:13 AM
  6. [SOLVED] Date Filter based on Cell Input - single date or range of dates
    By babaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 10:32 AM
  7. Returning Multiple Rows based on Date Range
    By danomite in forum Excel General
    Replies: 6
    Last Post: 02-07-2009, 04:15 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