+ Reply to Thread
Results 1 to 6 of 6

Finding the next value that is different in a column

  1. #1
    Registered User
    Join Date
    07-04-2008
    Location
    Canada
    Posts
    12

    Finding the next value that is different in a column

    I would like to have a formula that can tell me what the next value is in a column that is different than a known value. If I have a column that has some value "A" and then later in the column changes to "B" (which could happen anywhere in the column), I would like to have two boxes that can tell me the values "A" and "B". I know how to get the value for "A" since I can look at the first cell of that column but I don't know how to get it to look for "B". It can't be that hard but I am just not finding it.

    Thanks,

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Finding the next value that is different in a column

    This will find the first entry in A1:A10 that contains something other than what is in A1

    =INDEX(A1:A10,MATCH(TRUE,INDEX(A1:A10<>A1,0),0))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-04-2008
    Location
    Canada
    Posts
    12

    Re: Finding the next value that is different in a column

    That works great! How would I get it to return a blank if it doesn't find a different value?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Finding the next value that is different in a column

    Try:

    =IF(ISNUMBER(MATCH(TRUE,INDEX(A1:A10<>A1,0),0)),INDEX(A1:A10,MATCH(TRUE,INDEX(A1:A10<>A1,0),0)),"")

  5. #5
    Registered User
    Join Date
    07-04-2008
    Location
    Canada
    Posts
    12

    Re: Finding the next value that is different in a column

    I am getting a #Value return, is it because my column contains alphanumeric entries? Is there something similar to isnumber I could use?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Finding the next value that is different in a column

    The ISNUMBER() function is not checking that you have numeric data. It is checking that the result of the MATCH() function it surrounds is numeric... so doesn't matter your data.

    The only thing I can tell is that perhaps you have an error in the range of data somewhere? Even then it would skip it...

    can you post a sample workbook, no confidential data.

+ 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