+ Reply to Thread
Results 1 to 10 of 10

List out historical data with INDEX x MATCH x ?

  1. #1
    Registered User
    Join Date
    08-13-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    4

    List out historical data with INDEX x MATCH x ?

    Hi guys, i'm working on a search function on my worksheet. so basically, i have a database and on the main page, i would like to type in a name and a style then have excel to find the most recent 10 entries within my database by providing me "item name, style, date, counts". Can anyone show me how? thanks in advance!

    my current method is: enter name and style then {index(time/date/counts, match(name,name*style,style)}, but i can only get 1 line out and couldn't get the rest (ideally, 10 lines)
    Attached Files Attached Files
    Last edited by pcgk33; 08-13-2018 at 10:59 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: List out historical data with INDEX x MATCH x ?

    Welcome to the forum!

    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.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: List out historical data with INDEX x MATCH x ?

    Agree that a sample WB is needed here, also showing expected outcome.

    You will probably need the INDEX/IF/SMALL() ARRAY function for this
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    08-13-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    4

    Re: List out historical data with INDEX x MATCH x ?

    Thank you!! Ali & Ford!
    Last edited by pcgk33; 08-13-2018 at 11:01 PM. Reason: missing part

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: List out historical data with INDEX x MATCH x ?

    I changed my approach after I saw your data. If you would be OK with using a helper column (which you can hide if needed), you can simplify this greatly

    DB G4=IF(AND(B4=FP!$C$5,DB!C4=FP!$D$5),G3+1,G3)
    copied down as needed
    This is the helper that creates a unique ID for all entries matching your criteria

    To extract the data (H8 is wrong btw)...
    B
    C
    D
    E
    7
    Purchase Date Purchase Price Invoice Number
    8
    1
    11/7/2018
    28000
    181101-DC041
    9
    2
    11/4/2018
    14000
    181101-DC035
    10
    3
    11/3/2018
    17500
    181101-DC034
    11
    4
    12
    5
    13
    6
    14
    7
    15
    8
    16
    9
    17
    10


    C8=IFERROR(INDEX(DB!$B$4:$F$23,MATCH(MAX(DB!$G:$G)-10+(11-$B8),DB!$G$4:$G$23,0),MATCH(C$7,DB!$B$3:$F$3,0)),"")
    copied down and across as needed

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: List out historical data with INDEX x MATCH x ?

    Here's a different approach that uses no helper columns:

    Excel 2016 (Windows) 32 bit
    H
    I
    J
    7
    Purchase Date Purchase Price Invoice Number
    8
    03/11/2018
    17500
    181101-DC034
    9
    04/11/2018
    14000
    181101-DC035
    10
    07/11/2018
    28000
    181101-DC041
    Sheet: FP

    Excel 2016 (Windows) 32 bit
    H
    8
    =IFERROR(INDEX(DB!$D$1:$D$1000,AGGREGATE(15,6,ROW($4:$1000)/((DB!$B$4:$B$1000=H$5)*(DB!$C$4:$C$1000=I$5)),ROW(1:1))),"")
    Sheet: FP

    Excel 2016 (Windows) 32 bit
    I
    8
    =IFNA(LOOKUP(2,1/((DB!$B$4:$B$1000=H$5)*(DB!$C$4:$C$1000=I$5)*(DB!$D$4:$D$1000=$H8)),DB!$E$4:$E$1000),"")
    Sheet: FP

    Excel 2016 (Windows) 32 bit
    J
    8
    =IFNA(LOOKUP(2,1/((DB!$B$4:$B$1000=H$5)*(DB!$C$4:$C$1000=I$5)*(DB!$D$4:$D$1000=$H8)),DB!$F$4:$F$1000),"")
    Sheet: FP

  7. #7
    Registered User
    Join Date
    08-13-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    4

    Re: List out historical data with INDEX x MATCH x ?

    thank you very much! it is very useful!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: List out historical data with INDEX x MATCH x ?

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Registered User
    Join Date
    08-13-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    4

    Re: List out historical data with INDEX x MATCH x ?

    I finally get to learn =aggregate now, thank you very much! masterpiece.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: List out historical data with INDEX x MATCH x ?

    Bear in mind it only works in newer versions of Excel: https://support.office.com/en-us/art...6-e19993fa26df

+ 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. [SOLVED] Index and Match to display data from another list
    By Crawfy in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-21-2018, 06:28 PM
  2. [SOLVED] INDEX MATCH in a List Data Validation
    By alaramee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-16-2018, 01:21 PM
  3. Index-Match Data Validation List not working
    By totally_lost in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-16-2014, 09:27 AM
  4. [SOLVED] Index-Match Data Validation List
    By DinghoAteMyBaby in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-22-2013, 10:42 AM
  5. Replies: 6
    Last Post: 01-23-2013, 02:21 PM
  6. Data Validation List Using Index & Match Formula
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2012, 03:08 AM
  7. [SOLVED] Index Match - Data Validation List - Result N/A
    By Veloso in forum Excel General
    Replies: 4
    Last Post: 07-21-2012, 12:49 PM

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