+ Reply to Thread
Results 1 to 7 of 7

Problem with function INDEX, SMALL AND IF

  1. #1
    Registered User
    Join Date
    10-08-2014
    Location
    New York
    MS-Off Ver
    Excel 365 -Mac-
    Posts
    8

    Problem with function INDEX, SMALL AND IF

    Hello everyone,

    I am new to this forum and I am trying to create a sheet where, when I list all the quantities of ingredients then they will show up on a side of the spreadsheet ranked from highest concentration to the lowest. As I may have more than one ingredient with the same concentration I couldn't use Lookup so I used the index function.

    Here is the function
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Everything work great except when I have for example 3 ingredients with a concentration of 300g and then 5 ingredients with a concentration of 200g. In this case I figured out that I would need to get the ROW(2:2) function back to ROW(1:1) when it changes from one weight to another. I don't know how to do that. I am sorry if you didn't understand what I am trying to explain. I enclosed a file with an example of what I am trying to do. You will see the first row is the problem I have and the second the formula how it should be generated in order to work.

    I am a french native so I am sorry if my english is not proper as it is my second language.

    Thank you!

    Jules
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Problem with function INDEX, SMALL AND IF

    Have you hit ctrl shift enter after writing the formula?
    Last edited by sakmsb; 10-08-2014 at 12:29 PM.
    If I've been of help, plz add reputation.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Problem with function INDEX, SMALL AND IF

    You can use COUNTIF in place of ROW function,i.e. this version in D4 copied down

    =INDEX($A$4:$B$107;SMALL(IF($B$4:$B$107=E4;ROW($B$4:$B$107));COUNTIF(E$4:E4;E4))-3;1)
    Last edited by daddylonglegs; 10-08-2014 at 12:53 PM.
    Audere est facere

  4. #4
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Problem with function INDEX, SMALL AND IF

    Quote Originally Posted by daddylonglegs View Post
    You can use COUNTIF in place of ROW function,i.e. this version in D4 copied down

    =INDEX($A$4:$B$107;SMALL(IF($B$4:$B$107=E4;ROW($B$4:$B$107));COUNTIF(E$4:E4;E4))-3;1)
    ahh countif to count no. of records of look up value... learnt something new.

    I was trying to get it done with ROWS($E$4:E4)-ROWS(E4) and such combinations...

  5. #5
    Registered User
    Join Date
    10-08-2014
    Location
    New York
    MS-Off Ver
    Excel 365 -Mac-
    Posts
    8

    Re: Problem with function INDEX, SMALL AND IF

    I will try with countif. And yes I did use the array formula but I am on mac so it is command + enter. I will keep you posted! Thank you for taking time on that!

  6. #6
    Registered User
    Join Date
    10-08-2014
    Location
    New York
    MS-Off Ver
    Excel 365 -Mac-
    Posts
    8

    Re: Problem with function INDEX, SMALL AND IF

    Ok it works great, thank you so much. Could you explain to me what does COUNTIF do in that function to make it work. It's ok if you doesn't have the time! Thank you again everybody!

  7. #7
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Problem with function INDEX, SMALL AND IF

    Quote Originally Posted by dejussy View Post
    Ok it works great, thank you so much. Could you explain to me what does COUNTIF do in that function to make it work. It's ok if you doesn't have the time! Thank you again everybody!
    Hi,

    As I said in my comment above, there are duplicate look up values, like 1000 is twice and 22 is thrice in the list, that's why countif to count the number of occurrences.

    If you want to learn more about these(ctrl shift enter) search for youtube channel excelisfun

    Hope this helps!

+ 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: 6
    Last Post: 10-22-2013, 01:48 PM
  2. Problem with Index and Small functions to lookup and display multiple cells
    By oneblondebrow in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-22-2013, 11:41 AM
  3. [SOLVED] Help speed up slow INDEX (SMALL function
    By submariner18 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2012, 01:14 PM
  4. [SOLVED] Optimizing/speeding up a slow INDEX & SMALL function for retrieving multiple matches
    By lesoies in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2012, 11:56 AM
  5. INDEX SMALL ROW array function
    By ACurtis802 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-10-2009, 02:10 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