+ Reply to Thread
Results 1 to 10 of 10

Extracting data from a table with multiple rows and columns

  1. #1
    Registered User
    Join Date
    04-19-2020
    Location
    London
    MS-Off Ver
    Microsoft Excel For Mac - Microsoft 365 - Version 16.67
    Posts
    22

    Extracting data from a table with multiple rows and columns

    Hi All,

    I have a table with 142 ingredients in column 1 and then numerous spice mixes in the top row with corresponding ingredient weights manually inputted under each spice mix. Obviously not all spice mixes include all the underlying spices so there are many blanks under each spice mix. I need to create a formula that will look up the spice mix and return the underlying ingredients with corresponding weights. I don't want to use filters as the number of spice mixes will grow. I would also like the output to only show the ingredients under the relevant spice mix and leave out all blanks, thus a small table of only the underlying ingriendents and weights.

    I have attached a small section of the spreadsheet below.

    I would be grateful for your help.

    Many thanks,
    BranAlex
    Attached Files Attached Files
    Last edited by BranAlex; 04-19-2020 at 11:14 AM.

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

    Re: Extracting data from a table with multiple rows and columns

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  3. #3
    Registered User
    Join Date
    04-19-2020
    Location
    London
    MS-Off Ver
    Microsoft Excel For Mac - Microsoft 365 - Version 16.67
    Posts
    22

    Re: Extracting data from a table with multiple rows and columns

    Hi Ali,

    Many thanks. I have attached the sample work, are you able to assist?

    Thanks
    BranAlex

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Extracting data from a table with multiple rows and columns

    Hi & welcome to the board.
    How about, in F7
    =IFERROR(INDEX($A$2:$A$143,AGGREGATE(15,6,(ROW($A$2:$A$143)-ROW($A$2)+1)/(INDEX($B$2:$C$143,,MATCH($F$6,$B$1:$C$1,0))<>""),ROWS(F$7:F7))),"")
    In G7
    =IFERROR(INDEX($B$2:$C$143,MATCH(F7,$A$2:$A$143,0),MATCH($F$6,$B$1:$C$1,0)),"")

    Or if you have dynamic arrays
    In F7 only (put the word List in A1)
    =FILTER(FILTER(A2:C143,(A1:C1=F6)+(A1:C1="list")),INDEX(B2:C143,0,MATCH(F6,B1:C1,0))<>0)
    Last edited by Fluff13; 04-19-2020 at 12:59 PM.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Extracting data from a table with multiple rows and columns

    Hi Bran,

    No formulas needed!! Just put the word "Ingredients" in A1 and do a Pivot Table. You'll need to filter the Pivot by Values that are greater than zero and sort from small value to large value.

    See the attached: Spice Recipe Analyses Pivot Solution.xlsx

    Time to learn more about Pivot Tables?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    04-19-2020
    Location
    London
    MS-Off Ver
    Microsoft Excel For Mac - Microsoft 365 - Version 16.67
    Posts
    22

    Re: Extracting data from a table with multiple rows and columns

    Many thanks again all.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Extracting data from a table with multiple rows and columns

    You're welcome & thanks for the feedback

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Extracting data from a table with multiple rows and columns

    No formulas - No Pivots - No manipulation
    Table self expanding - just put your new mix name in header or new extra ingredients/quantities in rows.
    Do not forget to press the green button first.
    torachan.
    Attached Files Attached Files
    Last edited by torachan; 04-22-2020 at 10:50 AM.

  9. #9
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Extracting data from a table with multiple rows and columns

    torachan - did you do that in VBA?

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Extracting data from a table with multiple rows and columns

    Code attached, short & sweet.
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 09-16-2019, 01:52 AM
  2. Replies: 1
    Last Post: 06-08-2016, 10:19 PM
  3. Extracting data from one sheet to another, not in same rows or columns
    By mindrumk424 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2013, 05:13 PM
  4. Extracting Unique cell value from a table containing 2 rows and 2 columns
    By amitnbhatia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2013, 01:13 AM
  5. extracting rows of data from a table that are met by criteria in two separate columns
    By markhocek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2013, 03:20 AM
  6. Extracting unique entries from table with multiple rows and columns
    By Bonnister in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2012, 11:48 AM
  7. Need Forumlas for extracting from multiple columns/rows
    By icanspeakwhale in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2011, 01:48 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