+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting & Finding Duplicates

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2003
    MS-Off Ver
    Excel 2007
    Posts
    13

    Conditional Formatting & Finding Duplicates

    I have a 12 x 12 matrix of names. Columns represent INNINGS of a baseball game and rows represent their defensive POSITIONS played that inning. So, for each game I don't want to repeat names in an inning (column) but over a game I can repeat someone at a position (row) no more then twice. How can I use conditional formatting to help me identify when I have violated my constraints? When I repeat someone in a column I would like the person(s) name to show up red for the number of times in the column. For the rows, when I have repeated a name more then twice over 12 innings I would like the cell fill color to be light yellow.

    Thanks,

    Mike

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Conditional Formatting & Finding Duplicates

    Hi mluetkem,

    Assuming the top left name in your matrix is in cell B2, select range B2:M13 then go to Conditional formatting.

    Condition 1 (Red)

    Formula is =COUNTIF(B$2:B$13,B2)>1

    Condition 2 (Yellow)

    Formula is =COUNTIF($B2:$M2,B2)>2

    Cheers,
    Last edited by ConneXionLost; 01-17-2010 at 08:28 PM.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Conditional Formatting & Finding Duplicates

    If you're in 2003 or earlier, make sure the yellow rule is the top one. Pre-2007, Excel would find a rule that evaluates to true and then stop, so if the red rule is the top one, you would have no yellows. Perhaps a better way is to modify the first formula to be =2 instead of >1.

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Conditional Formatting & Finding Duplicates

    Darkyam,

    I'm afraid I don't understand your reasoning. The red formula is counting through the column while the yellow formula is counting through the row. Either way, the result will only effect the individual cell at the intersection. Further, if red overrides yellow, there's a better chance to see other yellow cells (>2) than there is other red cells. Finally, it'd be a greater error to list one person in two positions than to let them play more than two games.

    Please explain.

    Cheers,

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Conditional Formatting & Finding Duplicates

    The explanation is simple: I'm a dunce. I didn't see that one was doing rows and the other columns. It's what I get for not paying attention.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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