+ Reply to Thread
Results 1 to 7 of 7

Display all data within Start and end date

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    14

    Display all data within Start and end date

    Hi All,

    I can't resolve the following problem:

    I've got a start and end date in resp cell A2 and B2.

    Beneath these cells I've sorted some dates with matching data.

    Does someone know how I can display all the dates with their matching data which are in the selected interval? I want to prevent blank cells, maybe something with an array function?

    Thnx in advance!!

    help.xlsx

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Display all data within Start and end date

    hi spangpang. try this array formula in E5:
    Formula: copy to clipboard
    =IFERROR(INDEX(A$4:A$16,SMALL(IF($A$4:$A$16>=$A$2,IF($A$4:$A$16<=$B$2,ROW($A$4:$A$16)-ROW($A$4)+1)),ROWS(E$5:E5))),"")


    drag down & across. question: why is A11:B11 excluded? isnt it within the date?

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    08-01-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Display all data within Start and end date

    My bad! You are right!, I'm going to try i right away! Thnx

    Quote Originally Posted by benishiryo View Post
    hi spangpang. try this array formula in E5:
    Formula: copy to clipboard
    =IFERROR(INDEX(A$4:A$16,SMALL(IF($A$4:$A$16>=$A$2,IF($A$4:$A$16<=$B$2,ROW($A$4:$A$16)-ROW($A$4)+1)),ROWS(E$5:E5))),"")


    drag down & across. question: why is A11:B11 excluded? isnt it within the date?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Display all data within Start and end date

    Hi,

    You need to use Data-->Advanced Filter-->Copy to another location and specify the the output range and criteria ranges.

    I've set this up with a macro in the attached. Note your original example was missing the Tupolev on 6 April.

    Regards

    The
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Display all data within Start and end date

    Put this formula in C4:

    Formula: copy to clipboard
    =IF(AND(A4>=A$2,A4<=B$2),MAX(C$3:C3)+1,"-")


    and copy down to the bottom of your data. Then you can get the first date using this formula:

    Formula: copy to clipboard
    =IFERROR(INDEX(A:A,MATCH(ROWS($1:1),$C:$C,0)),"")


    and the corresponding name using this in the adjacent cell:

    Formula: copy to clipboard
    =IFERROR(INDEX(B:B,MATCH(ROWS($1:1),$C:$C,0)),"")


    (actually, this is just the previous formula copied into it).

    Format the date cell as you wish to see it, then copy these two formulae down as far as you need to. Then change the start or end dates on row 2 and the list will automatically adjust.

    Not sure why you are not showing the Tupolev flight on 6th April in your list.

    Hope this helps.

    Pete

  6. #6
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Display all data within Start and end date

    Another solution with array-formulas.
    If your data table becomes large, these formulas will slow down your calculations.
    In that case a VBA solution will be better.
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  7. #7
    Registered User
    Join Date
    08-01-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Display all data within Start and end date

    Thank you for the effor! I've solved it now with the help you provided!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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