+ Reply to Thread
Results 1 to 4 of 4

Selection of Excel table column based on a header

Hybrid View

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    Paris, France
    MS-Off Ver
    2010
    Posts
    15

    Selection of Excel table column based on a header

    Hey guys,

    So I attach a sample file where I have a table that acts as the database for recording country and continent wise output of various products. Based on this table, I have another table which gives the continent wise output of the products. Now, the database table is an excel table and products either have names (Maize, Cheese, etc) or number (21,22,etc)
    The user has an option to choose the continent based on which the results table should choose the column of the relevant product and produce the sum for that continent (clearer in the sample)

    I use the formula

    =SUMIFS(INDEX(TabOutput;0;MATCH(A14;TabOutput[#Headers];0));TabOutput[Continent];$A$11)

    which works brilliantly for products with names (Maize) but fails terribly for those with nos (21). Could someone kindly explain this to me please and also how to resolve it? Thanks a bunch!variable table column selection.xlsx

    Regards,
    Alpana SAVARNA

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Selection of Excel table column based on a header

    Those column headers are text...not numbers.
    Try this formula, copied down, in your table:
    B14: =SUMIFS(INDEX(TabOutput,0,MATCH(""&A14,TabOutput[#Headers],0)),TabOutput[Continent],$A$11)
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    08-13-2014
    Location
    Paris, France
    MS-Off Ver
    2010
    Posts
    15

    Re: Selection of Excel table column based on a header

    Brilliant!
    That seems to work. Thanks! I didn't know that concatenating "" with something converts the something into text.

    Have a great day Ron.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Selection of Excel table column based on a header

    Glad you got something you can use!

    If that resolves your issue, please take a moment to mark this thread as SOLVED (from the Thread Tools menu)

+ 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] Find Row in Table based on Column Header
    By thisguy4000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2014, 12:55 PM
  2. Look up row header based on column and table answer
    By jherbert81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-14-2014, 05:58 PM
  3. [SOLVED] Extract the column header given the row header and highest value in a subset of a table
    By pguarino in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-20-2013, 02:05 AM
  4. Replies: 1
    Last Post: 05-10-2013, 02:03 PM
  5. [SOLVED] Create Dynamic Column Lookup Reference based on Table Header
    By jeversf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-22-2013, 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