+ Reply to Thread
Results 1 to 3 of 3

Find first occurrence of a 0

Hybrid View

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    7

    Find first occurrence of a 0

    I would like to find the occurrence of the first 0 or negative number in a column and come up with the number in the adjacent column. For example:

    Column A Column B
    1 6
    2 4
    3 12
    4 4
    5 1
    6 0
    7 -2
    8 -4
    9 5

    Since the first 0 or negative number is -2 then answer would be 6.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Find first occurrence of a 0

    Try in ... say D1

    =INDEX(A2:A10,MIN(MATCH(0,B2:B10,0),MATCH(TRUE,INDEX((B2:B10<0),0),0)))

    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Find first occurrence of a 0

    =index(a1:a9,match(true,index(b1:b9<=0,0),0))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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