+ Reply to Thread
Results 1 to 7 of 7

Format Table (Index/Match)?

  1. #1
    Registered User
    Join Date
    03-25-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    Office365
    Posts
    3

    Format Table (Index/Match)?

    Dear community

    I'm having a table with two columns and different rows with repeating variables with hundreds of values. Like this:

    Annotation 2020-03-25.png

    My goal ist to format it like this and I cannot find out how, since the variables are not repeated regularly per object :-/
    Annotation 2020-03-25_2.png

    May someone help me with a formula?
    (the excel file is attached)

    Any help is appreciated!
    Thanks a lot.
    Attached Files Attached Files

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,369

    Re: Format Table (Index/Match)?

    Put this on E2 and then copied down and cross as necessary

    =IFERROR(INDEX($B$2:$B$31,AGGREGATE(15,6,(ROW($B$2:$B$31)-MIN(ROW($B$2:$B$31))+1)/($A$2:$A$31=E$1),ROW(A1))),"")
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Format Table (Index/Match)?

    at E2 array formula (Ctrl + shift + enter)
    =IFERROR(INDEX($B$1:$B$31,SMALL(IF($A$2:$A$31=$E$1,ROW($A$2:$A$31)),ROW(1:1))+COLUMN(A1)-1),"")

    copy cross and down

  4. #4
    Registered User
    Join Date
    03-25-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    Office365
    Posts
    3

    Re: Format Table (Index/Match)?

    Hey guys, Thanks a lot for your help.
    But both solution don't work currently. :-( And I have no idea how to solve that.
    The first solution is ignoring, that the Objects of are not always the same for each interface.

    Object1 has this:
    Name interface Port-channel1
    description Blalba1
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 10,20,30,40
    switchport mode trunk


    Object2 has this:
    Name interface GigabitEthernet1/0/3
    description Blalba4
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 10,20,30,40
    switchport mode trunk
    channel-group 3 mode on

    So for object 2, there is a value which does not exist for Object 1 (channel-group). So I would need a formula, on which I can add values which do not exist for all Objects.

    Thank you so much for any help.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Format Table (Index/Match)?

    When the data gets this disorganized, I would switch to a VBA solution to simply build the output table each time based on the data it finds in A:B.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Format Table (Index/Match)?

    Here we go, no VBA.

    1) You will create your row of headers across row 1 starting at E1. Put the possible categories in there in any order you wish. When you spot new possibilities in column A, add a header for that in a new column on row 1.

    You can always use an ADVANCED FILTER to copy out the unique values from column A anytime you want to check this row of headers.

    2) Now paste your new data into columns A:B

    3) Next, two helper columns will be used to keep things easy.

    C2 formula: =IF(A2="Name", N(C1)+1, N(C1))
    D2 formula: =C2&"-"&A2

    4) Copy C2:D2 down to the bottom of the data.

    5) Now put this formula in E2 to start the table:

    E2: =IFERROR(INDEX($B:$B, MATCH(ROW($A1)&"-"&E$1, $D:$D, 0)),"")

    6) Copy E2 across row2 as far as needed.

    7) Now copy down as far as needed until you start seeing blank rows.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-25-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    Office365
    Posts
    3

    Re: Format Table (Index/Match)?

    Hi JBeaucaire,

    Thank you so much for your precious help! This solves my problem perfectly!

    Thank you and have a wonderful week!
    Take care!

+ 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. INDEX MATCH from table with multiple MATCH criteria
    By nostrum in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-30-2019, 11:41 AM
  2. [SOLVED] Index Match Match for a small table lookup
    By slvrbktom in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 09-05-2018, 06:08 PM
  3. Replies: 9
    Last Post: 05-21-2016, 01:13 PM
  4. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  5. [SOLVED] Index Match Match returning incorrect value from table
    By DaveBre in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-04-2014, 08:01 PM
  6. Replies: 3
    Last Post: 05-19-2014, 02:01 PM
  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