+ Reply to Thread
Results 1 to 6 of 6

Index Match Between Tables

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    Index Match Between Tables

    Hi all,

    I'm currently working between a couple of two tables and finding it fairly tedious copying/pasting between them.

    I've been messing around with index/match formulae, but can't quite get them to stick.

    I'm essentially trying to populate one table with data contained in the another (see attached workbook).

    Any guidance would be greatly appreciated!

    D.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,736

    Re: Index Match Between Tables

    There are two impediments to doing what you state.

    1. Merged cells (Table 2) cause havoc for formulas. Repeating the row headers is preferable.
    2. The offset row sub headers in the second table are not consistent with those in the first table. While relatively minor, those can make formulas more complicated. Replacing the merged cells with repeating headers will help. A helper column can fulfill the role of repeating headers, but as a general rule one should avoid merged cells. They are the devil's spawn.

    What method would you prefer? Repeating headers ... helper column.

    Edit I failed to mention that helper columns can be hidden. I would propose inserting a new column A and put it there.

    Since there is no sample output in Table 2 I am not able to discern how M and F (more merged cells) factor in that output. Please explain that part.
    Last edited by FlameRetired; 09-18-2018 at 05:04 PM.
    Dave

  3. #3
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    Re: Index Match Between Tables

    Quote Originally Posted by FlameRetired View Post
    There are two impediments to doing what you state.

    1. Merged cells (Table 2) cause havoc for formulas. Repeating the row headers is preferable.
    2. The offset row sub headers in the second table are not consistent with those in the first table. While relatively minor, those can make formulas more complicated. Replacing the merged cells with repeating headers will help. A helper column can fulfill the role of repeating headers, but as a general rule one should avoid merged cells. They are the devil's spawn.

    What method would you prefer? Repeating headers ... helper column.
    Haha, thanks for the quick response!

    I definitely plan on unmerging the cells, and my instinct would say that repeating headers would be easier, the only issue is that the green table is a copy of a pivot table I'm currently using, so repeating headers may or may not be an issue, unless I create another header above the table that can/does repeat. Otherwise, I would go with the helper column.

    Thanks again!

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,736

    Re: Index Match Between Tables

    Good deal!

    I guessed correctly.

    In the attached find (now un hidden) a helper column A. This formula repeats the merged row headers.
    Formula: copy to clipboard
    =IF(B37="",A36,B37)
    I figured out the M F headers and their role in the output columns. In D37:H41
    Formula: copy to clipboard
    =INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
    MATCH(LOOKUP("zzzzz",$D$35:D$35),$C$1:$O$1,0)-1+MATCH(D$36,$C$2:$O$2,0))
    With that range selected copy and paste into cells D43, D49, D55, J37, J43, J49 and J55.

    For the subtotals by M and F in I37:I41
    Formula: copy to clipboard
    =INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
    MATCH(2,INDEX(1/(LOOKUP("zzzzz",$D$35:D$35)=$C$1:$O$1),0),1))
    Then copy that range and paste into the remaining relative cells columns I and O. The formula subtotals for each A, B, C ... E and gender subtotals are self explanatory. Again copy the first range and paste into relevant cells.

    I assume you know how to hide column A if desired.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-09-2015
    Location
    Canada
    MS-Off Ver
    Office Home and Student 2021 for Mac
    Posts
    170

    Re: Index Match Between Tables

    Quote Originally Posted by FlameRetired View Post
    Good deal!

    I guessed correctly.

    In the attached find (now un hidden) a helper column A. This formula repeats the merged row headers.
    Formula: copy to clipboard
    =IF(B37="",A36,B37)
    I figured out the M F headers and their role in the output columns. In D37:H41
    Formula: copy to clipboard
    =INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
    MATCH(LOOKUP("zzzzz",$D$35:D$35),$C$1:$O$1,0)-1+MATCH(D$36,$C$2:$O$2,0))
    With that range selected copy and paste into cells D43, D49, D55, J37, J43, J49 and J55.

    For the subtotals by M and F in I37:I41
    Formula: copy to clipboard
    =INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
    MATCH(2,INDEX(1/(LOOKUP("zzzzz",$D$35:D$35)=$C$1:$O$1),0),1))
    Then copy that range and paste into the remaining relative cells columns I and O. The formula subtotals for each A, B, C ... E and gender subtotals are self explanatory. Again copy the first range and paste into relevant cells.

    I assume you know how to hide column A if desired.
    Wow, this worked phenomenally. Can't thank you enough!

    I've hidden the helper column and it definitely looks less crowded. Thank you again for the amazing guidance.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,736

    Re: Index Match Between Tables

    You are welcome. Thank you for the feedback, rep and marking thread Solved.

    Since you are relatively new to the forum you may not be aware of one of our guidelines footnoted in the rules. Though not a rule ...
    2. Don't quote whole posts -- it's just clutter.*

+ 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] OFFSET INDEX MATCH MATCH with multple tables
    By Paul103 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-07-2018, 02:29 PM
  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. [SOLVED] Index Match betwen two tables with 2nd criteria
    By rywillc in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-25-2017, 02:55 AM
  4. [SOLVED] INDEX/MATCH and SUMIFS with Tables
    By phpolicylady in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-17-2017, 10:55 AM
  5. Difference between two tables using index match?
    By TheFab in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2015, 09:38 AM
  6. INDEX MATCH IF Between Two Dates - Comparing Two Tables
    By #N/A in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2015, 09:32 AM
  7. Index Match Match Formula DOESN'T WORK WITH TABLES/TABLE NAMES ??
    By Underling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 09:01 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