+ Reply to Thread
Results 1 to 9 of 9

Help with Index and Small formula to look up data in multiple columns

  1. #1
    Registered User
    Join Date
    01-15-2020
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    15

    Help with Index and Small formula to look up data in multiple columns

    Good morning all,

    I'm hoping someone can help me with a formula i'm having a bit of trouble getting to work. Although i feel i have the foundations of the formula correct i cannot seem to get it to work as it should.

    I've got a set of data which includes types of Fruit and Recipes that can be made from that fruit. Each combination of fruit and recipe is further categorised into a 2 further categories - Letters (A to J) and Numbers (1 to 8). Each combination of fruit and recipe will have a proportion of letters (that add to 1) and a proportion of numbers (that add to 1). These 2 further categories need to be treated independently so the sum of the proportion each add to 1.

    I have included the data set as an attachment as it is a little tricky to explain but as an example -

    Baked Apple has a proportion of Numbers as 50% to category 2 and 50% to category 5 as well as a proportion of Letters as 20% each allocated to B, C, D, E & F.

    What i want to be able to do is for each combination of fruit and recipe type eg Baked Apple i want to alongside this combination list all the possible combinations of numbers and letters that are greater than 0%. For this example there are 10 possible combinations - 2 & B, 2 & C, 2 & D, 2 & E, 2 & F, 3 & B, 3 & C, 3 & D, 3 & E, 3 & F.

    The attachment includes the input data set as well as the output data set which for this set of data i have created manually to show but in actual fact i will need to replicate on a much larger different set of data.

    The formula i have tried uses Index as well as Small and Column/Row to try and produce what is in the output worksheet highlighted in yellow but cannot seem to pull it off.

    Any help with this would be much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Help with Index and Small formula to look up data in multiple columns

    Based on the sheet you attached, this would re-create it I think:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Help with Index and Small formula to look up data in multiple columns

    I'm not sure I understood correctly but try
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-15-2020
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Help with Index and Small formula to look up data in multiple columns

    Thank you both, i have just had a quick glance at both solutions and both seem to do what i wanted. I am not very knowledgeable in the way of VBA but certainly keen to learn so will have a look at this solution also. Thanks for your help

  5. #5
    Registered User
    Join Date
    01-15-2020
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Help with Index and Small formula to look up data in multiple columns

    Quote Originally Posted by BMV View Post
    I'm not sure I understood correctly but try
    Can you tell me how the formulas would change if the headers for the number category were text rather than number. I see the formulas are dependent on these headers being a number format but cannot seem to work out how to change the formula short of using a lookup later on.

  6. #6
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Help with Index and Small formula to look up data in multiple columns

    In this case two small changes have to be done.
    COLUMN($C$1:$J$1)-2 in stand of simple $C$1:$J$1 in input!v2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    And output!d2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with Index and Small formula to look up data in multiple columns

    Please try at
    B2:C2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Or
    Create Table from Input
    Open Power Query/Get and Transform. Click on New Query.
    Open blank query in the editor, launch Advanced Editor and paste in the following code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Help with Index and Small formula to look up data in multiple columns

    Bo_Ry, good trick
    (MMULT(--(Input!$C$2:$J$20>0),ROW(B$1:INDEX(B:B,COLUMNS(Input!$C$2:$J$20)))^0)*MMULT(--(Input!$K$2:$T$20>0),ROW(B$1:INDEX(B:B,COLUMNS(Input!$K$2:$T$20)))^0)>=COLUMN($A$1:$ZA$1)
    However two MMULT and Small/Aggregate(15 in the many rows is hard calculation.

  9. #9
    Registered User
    Join Date
    01-15-2020
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Help with Index and Small formula to look up data in multiple columns

    Thank you very much all, 3 excellent ways of producing what i need for a much larger data set. I need to have some time to examine exactly how each of these equations work. I thought i was fairly knowledgeable with excel formulas until i have seen some of these. I may come back with some further questions

+ 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 Small in an array of multiple rows and columns
    By AdamKuro in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-04-2019, 06:26 AM
  2. List data from a table with multiple headers? Index, Small, Lookup??
    By KDB13 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2019, 08:53 AM
  3. [SOLVED] Index small across multiple columns
    By Paul.Thompson in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-12-2018, 08:50 AM
  4. [SOLVED] Using multiple context in one formula (Iferror/Index/Small/IF/Row)
    By gilpin004 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2017, 01:32 PM
  5. Help with Index Small Formula with Multiple Criteria
    By mang0Master in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-09-2017, 12:09 PM
  6. [SOLVED] Putting OR inside a INDEX SMALL formula for multiple criteria, can it be done?
    By whetu in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-22-2014, 06:56 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