+ Reply to Thread
Results 1 to 8 of 8

First Instance of a Negative and Positive Number in Adjacent Columns

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    north carolina
    MS-Off Ver
    Excel 2010
    Posts
    3

    First Instance of a Negative and Positive Number in Adjacent Columns

    Hi everyone,

    I have 2 columns of numbers I'm trying to write a formula that will point me to the first instance of a negative value in the first column and a positive value on the
    same row in the adjacent column.

    I've searched the forum and tried combinations of the index and match formulas without success.

    Any help would be appreciated.

  2. #2
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    Do you want to find the first instance where BOTH of these instances occur (first column is negative AND 2nd column is positive)?
    Please click the * icon below if I have helped.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    So what result do you want?

    Do you want the numbers themselves, the row number or something else?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    04-18-2013
    Location
    north carolina
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    Yes, I need both conditions to be true - negative number in the first column and positive in the second column.

    Further, I am looking for the row number - not the values in the cells.

    Thanks.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    =MATCH(1,INDEX((B:B<0)*(C:C>0),0),0)
    for instance
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    Quote Originally Posted by 10OAKS View Post
    I am looking for the row number - not the values in the cells.
    OK, do you want the row number relative to the data range or do you want the absolute row number?

    If this is your data in the range A5:B9...

    row 5.....1......1
    row 6.....7.....-5
    row 7....-2......3
    row 8....-3......2
    row 9.....6.....-1


    The conditions are met on absolute row number 7 or relative row number 3. What result do expect?

  7. #7
    Registered User
    Join Date
    04-18-2013
    Location
    north carolina
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    Thank you JosephP. I tried your formula on my data and it gave me exactly the answer I wanted.

    Tony, I wanted the absolute row number and thank you for responding.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: First Instance of a Negative and Positive Number in Adjacent Columns

    Good deal. Thanks for the feedback!

+ 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