+ Reply to Thread
Results 1 to 7 of 7

Array formula to extract information in-between two dates

Hybrid View

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    13

    Array formula to extract information in-between two dates

    Hi, I need to be able to extract information in-between two dates from a data table

    I have a table with “person_names”, “place_visited”, “from_date” and “to_date” columns. I need to be able to extract the data per person, per place visited, per date. I wrote an INDEX MATCH array formula that works well to extract an exact date. My difficulty is extracting the in-between dates information. The dates between the “from_date” and the “to_date”

    My current array formula looks like this:
    =IFERROR(INDEX(Database, MATCH((PersonName & ThisDate), (Database[Name] & Database[From Date]),0), MATCH(“PlaceVisited”, Database[#Headers],0)),Null)

    Where PersonName is the Name of the person, ThisDate is the date I am extracting, Database[Name] is the person name column in my database, Database[From Date] is the From_Date column in my database, PlaceVisited is the heading name of the place visited in the database
    The above formula extracts an exact date’s information successfully.

    Please help me to improve this array formula to to extract information in-between two dates, the "From_Date" and the "To_date".

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: Array formula to extract information in-between two dates

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula to extract information in-between two dates

    Thank you for your tip:
    Small Example attached
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Array formula to extract information in-between two dates

    slt,
    see attached file for your reference,

    Hope this helps!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-24-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula to extract information in-between two dates

    Wow!!! SUMPRODUCT you are one clever dude!!
    Thank you very much!!

  6. #6
    Registered User
    Join Date
    05-24-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula to extract information in-between two dates

    Hi duanzhuanming,

    I find this SUMPRODUCT formula very unstable. It works well will little data but as soon as the data grows, it gives weird behavior.
    Attached is an example where I added more data then the formula "broke". To proof the point easily I changed the "Place visited" to the persons name so that it is easy to see inconsistencies.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Array formula to extract information in-between two dates

    Quote Originally Posted by Kayees View Post
    Hi duanzhuanming,

    I find this SUMPRODUCT formula very unstable. It works well will little data but as soon as the data grows, it gives weird behavior.
    Attached is an example where I added more data then the formula "broke". To proof the point easily I changed the "Place visited" to the persons name so that it is easy to see inconsistencies.
    Hi,
    The formula will return the incorrect value if it finds two true conditions! you can see the attached shot! on the same day(08/02)--> 2 different places! In this case, using "If" function instead of Sumproduct
    =IFERROR(INDEX(Database!$A$11:$A$225,MIN(IF((Database!$C$11:$C$225<=B$2)*(Database!$D$11:$D$225>=B$2)*(Database!$A$11:$A$225=$A3),ROW(Database!$B$11:$B$225)-10,6553655))),"")
    Confirmed with Ctrl+shift+Enter!
    see attached file,
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by duanzhuanming; 05-25-2013 at 05:03 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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