+ Reply to Thread
Results 1 to 10 of 10

Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (Rows)

  1. #1
    Registered User
    Join Date
    12-28-2020
    Location
    New Jersey
    MS-Off Ver
    2002
    Posts
    5

    Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (Rows)

    Hi Everyone,

    I have a table with multiple vertical and horizontal headers.

    The first horizontal header has shapes (Triangle, Quadrilateral) which are merged. The secondary horizontal header has sub categories (Equal sides, Not equal sides).

    The first vertical header has colors (Yellow, Blue) which are merged. The secondary vertical header has sub categories (Light, Medium, Dark).

    The table is then populated with digits in each cell.

    Excel sheet is attached.


    What I'm trying to accomplish is look up based on the shapes and their sub category as well as the color and the shade. Cells B11-B14 hold the input, and B16 would have the formula (combo of Hlookup,Index,Match,Vlook up,etc) with the result.

    For example -
    • The result for Shape=Triangle, Shape Sub=Equal sides, Color=Blue, Shade=Medium would be 5.
    • The result for Shape=Quadrilateral, Shape Sub= Not Equal sides, Color = Yellow, Shade=Dark would be 27.
    Attached Files Attached Files
    Last edited by jzee; 12-29-2020 at 01:32 AM.

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

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Try this...
    =INDEX($C$3:$F$8,MATCH(B13,A3:A8,0)+MATCH(B14,B3:B5,0)-1,MATCH(B11,C1:F1,0)+MATCH(B12,$C$2:$D$2,0)-1)
    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
    Registered User
    Join Date
    12-28-2020
    Location
    New Jersey
    MS-Off Ver
    2002
    Posts
    5

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Thank you!

    You simplified it so much.

    Can you explain this part for me please?
    MATCH(B13,A3:A8,0)+MATCH(B14,B3:B5,0)-1

  4. #4
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    271

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    One more option:
    HTML Code: 
    The formula could be much shorter if you don't use merged cells. Please refer to the sheet #2
    HTML Code: 
    Attached Files Attached Files

  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: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Quote Originally Posted by jzee View Post
    Thank you!

    You simplified it so much.

    Can you explain this part for me please?
    MATCH(B13,A3:A8,0)+MATCH(B14,B3:B5,0)-1
    Lets use the Blue/Medium in your example

    The 1st MATCH determines which color to pick (row 4), then because the shade is the same for both colors, I just used the 2nd MATCH to ID the shade (row 2 - and it doesnt matter which color I use for the shade, they are the same) - then added that value (2) to the value selected from the 1st MATCH (4). However, because the 2nd match would add 1 too many rows (I actually need 4 + 1, not 4 + 2) I needed to subtract 1.

    Hopefully that makes sense? If not, should and I will try explaining again.

  6. #6
    Registered User
    Join Date
    12-28-2020
    Location
    New Jersey
    MS-Off Ver
    2002
    Posts
    5

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Thanks much! Yes makes complete sense.

    This works if the sub-categories are the same.

    What if the subcategories weren't the same or there were a different amount in each? For example, under Triangle (Right, isosceles, Scalene) and under Quadrilateral (Square, Rectangle)?

  7. #7
    Registered User
    Join Date
    12-28-2020
    Location
    New Jersey
    MS-Off Ver
    2002
    Posts
    5

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Thank you. I'll need to review the formula.

    Unfortunately, the actual table I have contains many more categories (7 Vertical, 7 Diagonal) and so the merging provides a better representation.

  8. #8
    Registered User
    Join Date
    12-28-2020
    Location
    New Jersey
    MS-Off Ver
    2002
    Posts
    5

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Thanks much! Yes makes complete sense.

    This works if the sub-categories are the same.

    What if the subcategories weren't the same or there were a different amount in each? For example, under Triangle (Right, isosceles, Scalene) and under Quadrilateral (Square, Rectangle)?

  9. #9
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    271

    Re: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Quote Originally Posted by jzee View Post
    What if the subcategories weren't the same or there were a different amount in each? For example, under Triangle (Right, isosceles, Scalene) and under Quadrilateral (Square, Rectangle)?
    Still works.
    Attached Files Attached Files

  10. #10
    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: Index and Match - Multiple Vertical Headers (Colmn) and Multiple Horizontal Headers (R

    Quote Originally Posted by jzee View Post
    Thank you. I'll need to review the formula.

    Unfortunately, the actual table I have contains many more categories (7 Vertical, 7 Diagonal) and so the merging provides a better representation.
    Then I suggest you provide a more representative sample file for us to play with )

+ 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] Extract multiple row headers and column headers if criteria is met in multiple columns
    By PaulM100 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-20-2019, 04:56 AM
  2. Replies: 5
    Last Post: 12-16-2018, 10:09 AM
  3. Multiple headers when data is the same on a Index Match!!
    By Acousticlife81 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-05-2017, 01:25 PM
  4. [SOLVED] formula for multiple split headers of text and numbers to respective headers
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-19-2017, 10:17 AM
  5. Populate Combo box with Index/Match using horizontal headers
    By EimearC in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-12-2015, 08:25 PM
  6. Replies: 2
    Last Post: 06-14-2013, 10:01 AM
  7. Index Match Multiple Colums Headers
    By smigom in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2008, 04:49 AM

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