+ Reply to Thread
Results 1 to 18 of 18

INDEX MATCH | Multiple Results From 12 Different Tables

  1. #1
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    INDEX MATCH | Multiple Results From 12 Different Tables

    Hello everyone.

    I am having some trouble figuring out how to pull multiple results from multiple tables using INDEX MATCH.

    I have 12 tables (one for each month), and I'm trying to make an annual table that pulls specific data (based on a single criterion) from the 12 monthly tables.

    After Googling some similar problems, I've managed to get a working formula to pull data from two tables, but I can't figure out how to pull data from all 12 tables.

    The formula I have so far is:
    {=IFERROR(IFERROR(INDEX($A$2:$A$6,SMALL(IF(ISNUMBER(MATCH($B$2:$B$6,$B$15,0)),MATCH(ROW($B$2:$B$6),ROW($B$2:$B$6)),""),ROWS($A$1:A1))),INDEX($D$2:$D$6,SMALL(IF(ISNUMBER(MATCH($E$2:$E$6,$B$15,0)),MATCH(ROW($E$2:$E$6),ROW($E$2:$E$6)),""),ROWS($A$1:A1)-COUNTIF($B$2:$B$6,$B$15)))),"")}

    I have attached a sample file of what I'm working with.

    Any help is greatly appreciated; thanks!

    Edit:

    I have cross-posted on the following websites:
    https://www.mrexcel.com/board/thread...ables.1195297/
    https://chandoo.org/forum/threads/in...-tables.47538/
    https://www.excelguru.ca/forums/show...fferent-Tables
    Last edited by AliGW; 02-08-2022 at 03:42 AM. Reason: URLs added.

  2. #2
    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,926

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    I think that, by making a table for each month, you are making more work for yourself than necessary. If you has a single table for all months, your extract would be far simpler.
    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

  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,926

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

  4. #4
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Hello.

    I didn't realise that "cross-posting" was a potential problem.

    I tried to edit my post to include the cross-post links, but I was met with the following error:

    "The following errors occurred with your submission:
    You are not allowed to post any kinds of links, images or videos until you post a few times."


    So instead of posting the links, I posted the website names; I hope that is sufficient considering the circumstances.
    Last edited by AliGW; 02-08-2022 at 03:41 AM. Reason: PLEASE don't quote unnecessarily!

  5. #5
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Quote Originally Posted by FDibbins View Post
    I think that, by making a table for each month, you are making more work for yourself than necessary. If you has a single table for all months, your extract would be far simpler.
    Hey,

    Unfortunately, it is necessary in this situation to use a table for each month.

    The tables already exist, contain a fairly large amount of data, and are used by multiple people for various processes that are already in place.

    If I were to start from scratch, I would make one annual table, and then use INDEX MATCH to pull the relevant data for the 12 monthly tables.

  6. #6
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    May I ask, did all data are in separated sheet ? (ie. one month each ?) and in the same structure ?
    And how you deal with the same client that appear in multiple sheet with the same condition ?

    Regards.

    Note : I'm not sure is it ok to just post the website name for cross-linked post.

  7. #7
    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,926

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Quote Originally Posted by Saradomin View Post
    Hello....
    So instead of posting the links, I posted the website names; I hope that is sufficient considering the circumstances.
    Thats great, thanks

  8. #8
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Quote Originally Posted by menem View Post
    May I ask, did all data are in separated sheet ? (ie. one month each ?) and in the same structure ?
    And how you deal with the same client that appear in multiple sheet with the same condition ?
    Hey,

    Yeah, each month has its own table in its own sheet (so, 12 tables across 12 sheets).

    What I'm trying to do is create a 13th table on a 13th sheet, that pulls all the unpaid clients from all 12 monthly tables into a single annual table.

    In terms of duplicate clients, each entry has its own unique identifier, so hopefully I won't run into any issues there.

    What are your thoughts?

    Thanks

    Edit:
    I've added an excel file to try to better explain what I mean.
    Last edited by Saradomin; 02-08-2022 at 06:03 AM. Reason: Added attachment.

  9. #9
    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,479

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    This can be done with PowerQuery. If you would like me to show you how, please say. If you don't want to use PQ, then please also let me know.
    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.

  10. #10
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    If you don't mind to use many of helpers.

    1 try to count how many occur of criteria in each sheet.

    J5:J16 type name of sheets

    K5=COUNTIF(INDIRECT("'"&J5&"'!C:C"),$B$2)
    copy down to K16

    I5=0
    I6=+I5+K5
    copy down to I16

    2 build lookup rows of occurance
    E2=500 ( becuase I need to use match so this number can reduce range of rows to lookup / increase of decrease as needed )

    D5=IF(ROWS(D$4:D4)-1<SUM($K$4:$K$16),VLOOKUP(ROWS(D$4:D4)-1,$I$4:$J$16,2,TRUE),0)

    E5=IF(D5<>0,IF(D4=D5,E4+1,1),0)

    F5=IF(E5>0,IF(D4<>D5,
    MATCH($B$2,INDIRECT("'"&D5&"'!C:C"),0),
    MATCH($B$2,INDIRECT("'"&D5&"'!C"&F4+1&":C"&F4+$E$2),0)+F4),
    0)

    all copy down as need

    3 answer area
    B5=IF(E5>0,INDIRECT("'"&D5&"'!A"&F5),"")

    Regards.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    @Ali: as a complete PQ ignoramus, I would welcome instruction on how to address this using PQ. I have created tables in each sheet but where to go from here ...????

    UPDATE: now managed to combine (append) thanks to "You Tube" !

    Meanwhile a VBA offering

    Please Login or Register  to view this content.
    Last edited by JohnTopley; 02-08-2022 at 09:58 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  12. #12
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Quote Originally Posted by AliGW View Post
    This can be done with PowerQuery. If you would like me to show you how, please say. If you don't want to use PQ, then please also let me know.
    Hello, thank you for your message and your offer to help.

    Unfortunately I don't have any experience at all with PowerQuery, and as the spreadsheet is used by multiple people, I'd rather not use PowerQuery.

    The original spreadsheet I attached was a very simple version of the spreadsheet I am actually working with, and I thought I would be able to modify any formulas to work with it ... but it looks like I have overestimated by ability because I haven't had any luck so far.

    I was hoping to not just be handed the solution outright (I like to test things and learn new things), but I think I may be out of my depth with this one.

    I will attach a spreadsheet that is almost identical to what I'm working with (minus the sensitive data).

    Basically, I need the table in the Results tab to display the data in the columns "Data to Pull 1", "Data to Pull 2", "Data to Pull 3", and "Data to Pull 4" from all 12 monthly tabs, based on the criterion "Yes" that may appear in Column S.

    Thank you
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Hi menem,

    Firstly, I would like to thank you for offering a solution, although I must admit it is a little overwhelming

    I am having trouble modifying these formulas to work with the actual spreadsheet I am working with.

    If you wouldn't mind reading my response to AliGW, it explains my current situation, as well as includes an Excel file that is almost identical to the spreadsheet I am actually working with.

    Thanks!

  14. #14
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Hi JohnTopley,

    Thank you for posting a solution, although I don't think VBA will work as the spreadsheet will be used in Excel Online (I probably should have mentioned that; sorry!).

    I attached another Excel file in my response to AliGW which is almost identical to the spreadsheet I'm actually working with.

    I thought I would be able to modify the formulas from a simple table to work with a more complex table, but it turns out I don't know enough about Excel to get it working.

    Cheers.

  15. #15
    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,479

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Just for those who might be interested (e.g. John), attached is my PQ solution.

    It uses:

    1. Named ranges for each month - can be set as long as they will ever need to be.
    2. =Excel.CurrentWorkbook() in a blank query to pull the named rnages - filter this list to ignore anything beginning with Table or Results.
    3. The columns are expanded out (deselect the pesky tick box bottom left in the dialog) and then filtered to records containing No.
    4. Remove unwanted columns then Close & Load To ... your selected destination.

  16. #16
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    I've change relative cells of formula (use the same logic as above)

    except the output area have changed to
    A3
    =IFERROR(INDEX(INDIRECT("'"&$R3&"'!1:1000000"),$T3,COLUMN(A$1)),"")

    Regards.


    Note : Please maintain formula in column R,S,T equal to or more than the output.
    and you may change the red text to identify column number you want for each output.
    Last edited by menem; 02-11-2022 at 06:12 AM. Reason: add note

  17. #17
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    Menem ... this is ... absolutely perfect!

    Thank you so much!

    I think this completely solves my problem and I am very grateful to you
    Last edited by AliGW; 02-11-2022 at 08:50 AM. Reason: PLEASE don't quote unnecessarily!

  18. #18
    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,479

    Re: INDEX MATCH | Multiple Results From 12 Different Tables

    If you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. Need Help with Index, Match, Match with multiple results and copying data x times
    By jrboyd in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-27-2019, 06:57 AM
  2. [SOLVED] INDEX MATCH MATCH with multiple layered tables
    By acenewbie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-07-2018, 11:51 AM
  3. Index match multiple results
    By luke_reed in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-07-2017, 08:06 AM
  4. Index Match with multiple results
    By pitterpatton in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-10-2014, 10:41 PM
  5. [SOLVED] Index, Match, Multiple Results
    By ecorf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2013, 11:37 AM
  6. Index/Match with multiple results
    By kwadjo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2013, 04:05 PM
  7. Need help with Index + Match Multiple Results
    By xenohadden in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-11-2012, 05:00 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