+ Reply to Thread
Results 1 to 5 of 5

Formula Error for finding smallest values and index with horizontal cells

  1. #1
    Registered User
    Join Date
    08-25-2016
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    4

    Formula Error for finding smallest values and index with horizontal cells

    Hi, there
    I used below Formula with SMALL Function to look up the Lowest Value and Header Name without Zero. Unfortunately, it did not not work for looking up the 2nd Smallest Value and Header Name without Zero for the duplicated values and 3rd Smallest and so on as per below Formula.
    2nd smallest number without Zero
    Cell K6 Formula: IFERROR((SMALL($B6:$E6,COUNTIF($B6:$E6,0)+2))," ")

    Cell L6 Formula: IFERROR((INDEX($B$1:$E$1,MATCH(SMALL($B6:$E6,COUNTIF($B6:$E6,0)+2),$B6:$E6, 0)))," ")
    Meanwhile, when the lowest value is same with different Headers, I want to know those exact Header of the duplicated values with the mentioned formula. How can it be modified?
    Remark : +1 for 1st smallest value, +2 for the 2nd smallest value, +3 for the 3rd smallest value and so on.
    Formula Error.jpg
    Formula Error (1).xlsx

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Formula Error for finding smallest values and index with horizontal cells

    try
    for numbers: =IFERROR(SMALL(IF($B2:$E2>0,$B2:$E2),COLUMNS($B$1:B1)),"")
    for headers: =IFERROR(INDEX($B$1:$E$1,,MATCH(SMALL(IF($B2:$E2>0,$B2:$E2),COLUMNS($B$1:B1)),$B2:$E2,0)),"")

    both confirm by Control+Shift+Enter then drag down and to the right

    with your case it will give you 1st, 2nd, 3rd and 4th smalles value (or headers)

    edit:
    I didn't read details
    You want "remove" duplicates and with, eg. 1,1,2,3, second smallest should be 2?
    Last edited by sandy666; 03-05-2017 at 04:38 AM.

  3. #3
    Registered User
    Join Date
    08-25-2016
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    4

    Re: Formula Error for finding smallest values and index with horizontal cells

    Hello, Sandy
    Thanks for reviewing!! Actually, I need to keep the duplicated value and locate all related Headers. For instance of the style D111 (Cell A7), the lowest value is 1 and there are 3 different headers. Hence, hope that the formula can locate them all as well.

    Just wondering it may need the helper column at the end if the Headers of lowest value is more than 1.
    So, Maybe using the formula " COUNTIF(B7:E7, G7) " to locate " 3 " for the occurrence. But, I don't want to use eyeball to find those Headers.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Formula Error for finding smallest values and index with horizontal cells

    Try ..

    in M2

    =IF(B2=0,"",COUNTIF($B2:$E2,">"&B2)+COUNTIF($B2:B2,B2))

    Copy across to P and then down

    in G2

    =IFERROR(INDEX($B2:$E2,MATCH(LARGE($M2:$P2,1),$M2:$P2,0)),"")

    in H2

    =IFERROR(INDEX($B$1:$E$1,MATCH(LARGE($M2:$P2,1),$M2:$P2,0)),"")

    Copy both down

    Copy both pairs to I & J, K & L change highlighted 1 to 2 and 3 respectively.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-25-2016
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    4

    Re: Formula Error for finding smallest values and index with horizontal cells

    Hi, John
    Thanks for reviewing! It works great!!

+ 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: 5
    Last Post: 10-25-2016, 11:48 AM
  2. Average of Smallest 6 values returning error
    By uhlabomber in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2016, 11:41 AM
  3. Finding the smallest difference between a range of cells? Array formula?
    By dnlwstr in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-19-2014, 11:10 AM
  4. [SOLVED] INDEX MATCH and MIN/SMALL to pull first and second smallest values from array
    By tlafferty in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-18-2014, 04:03 AM
  5. Replies: 1
    Last Post: 11-08-2012, 06:09 AM
  6. finding 10 smallest unique values in a list
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2008, 08:59 PM
  7. Finding the smallest non zero number(#NUM Error)
    By aijihz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-19-2007, 02:28 PM

Tags for this Thread

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