+ Reply to Thread
Results 1 to 5 of 5

Finding nth non-zero in a row

  1. #1
    Registered User
    Join Date
    12-06-2013
    Location
    La Jolla, California
    MS-Off Ver
    Excel 365 & 2010
    Posts
    27

    Finding nth non-zero in a row

    I am currently using this array formula: =INDEX(M17:O17,SMALL(IF(M17:O17<>0,COLUMN(M17:O17)-COLUMN(M17)+1),U17))

    M17 to O17 contains 0, 5, 5, respectively. U17 contains a 3

    So, I thought I was finding the 3rd smallest which would be a 5 (which is also the 2nd smallest). However, it's an error.
    The formula works for finding the 2nd smallest (a 5) when U17 is a 2.

    How do I tweak this when the 2nd and 3rd, like this case, are the same? Or did I overlook something here (maybe)?

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Finding nth non-zero in a row

    Hi

    I don't know if I'm thinking well. With the data you send, {0, 5, 5}, the first smallest nonzero is the first 5 and the second the last 5. There are no third smallest nonzero.

    Can you explain better, please?

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Finding nth non-zero in a row

    What's wrong with

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Finding nth non-zero in a row

    Quote Originally Posted by Richard Buttrey View Post
    What's wrong with

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Topic title says non-zero
    I suppose @krweaver wants
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-06-2013
    Location
    La Jolla, California
    MS-Off Ver
    Excel 365 & 2010
    Posts
    27

    Re: Finding nth non-zero in a row

    Thank you...have resolved it. Have a different issue and will post separately shortly.

+ 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] Macro not finding finding selected characters in strings
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2017, 01:47 AM
  2. Replies: 2
    Last Post: 06-25-2017, 10:16 AM
  3. Finding an adjacent value after finding a maximum value on another column
    By VanCricken in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2016, 11:58 AM
  4. Finding Duplicates - Then finding delta
    By meppwc in forum Excel General
    Replies: 1
    Last Post: 09-30-2015, 04:10 PM
  5. Macro Finding / Finding a Sheet containing
    By DakotaDK810 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 12:17 AM
  6. Replies: 10
    Last Post: 12-17-2009, 02:00 AM
  7. Replies: 3
    Last Post: 03-02-2007, 07:13 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