+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting to find duplicate entries not working

  1. #1
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Conditional formatting to find duplicate entries not working

    Ok, I have a courier time tracking sheet that i used to evaluate courier times. One of the features is to compare the inputed time against a benchmark time. To do this I have a range of travel segments and their benchmark times.

    I have formatted these "travel segments" as follows.

    City1 <-> City2

    The "<->" signafies either to or from.

    So, what I want is conditional formatting that lets me know if a travel segment has already been entered for the two cities, even if transposed as "City2 <-> City1"

    The formula I have worked out is:

    =OR(MATCH(A2,A:A,0)<> ROW(A2), ISNUMBER(MATCH(RIGHT(A2,LEN(A2)-FIND(" <-> ",A2)-4) & " <-> " & LEFT(A2,FIND(" <-> ",A2)-1),INDIRECT("A1:A" & ROW(A2)-1),0)))

    This works just fine when I have this formula in a cell, but when I enter it as a conditional format, it doesn't work.

    Attached is an example workbook.
    Attached Files Attached Files
    Last edited by NBVC; 07-20-2010 at 11:49 AM.

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

    Re: Conditional formatting to find duplicate entries not working

    I replaced the INDIRECT with the INDEX equivalent and it works:

    Please Login or Register  to view this content.
    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
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional formatting to find duplicate entries not working

    if seen this before with OR but i dont know why!
    "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

  4. #4
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Conditional formatting to find duplicate entries not working

    Thanks, NBVC.

    The other solution I found was

    =OR(MATCH(A2,A:A,0)<>ROW(A2),IF(ISERROR(MATCH(RIGHT(A2,LEN(A2)-FIND(" <-> ",A2)-4)&" <-> "&LEFT(A2,FIND(" <-> ",A2)-1),A:A,0)<> ROW(A2))=FALSE,MATCH(RIGHT(A2,LEN(A2)-FIND(" <-> ",A2)-4)&" <-> "&LEFT(A2,FIND(" <-> ",A2)-1),A:A,0)<> ROW(A2)))

    But I like your mutch better because there is no if statement to double the processing.

    What's funny to me is that when I break the original formula apart, it works just fine.

    If I enter =ISNUMBER(MATCH(RIGHT(A2,LEN(A2)-FIND(" <-> ",A2)-4) & " <-> " & LEFT(A2,FIND(" <-> ",A2)-1),INDIRECT("A1:A" & ROW(A2)-1),0)), it calculates just fine. It is only when I make it an OR that it stops.
    Last edited by Whizbang; 07-20-2010 at 11:42 AM.

+ 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