+ Reply to Thread
Results 1 to 9 of 9

Highlight the cells that match??

  1. #1
    Forum Contributor
    Join Date
    06-29-2005
    Location
    TN
    MS-Off Ver
    Microsoft 365
    Posts
    327

    Highlight the cells that match??

    Hello All,
    I have a lil project in Excel and having trouble figuring how to make this work. I have a sheet with 16 rows and 32 columns. On each of the rows, I enter a zero or a 1 in each of the 32 columns. What I'm trying to figure out, how can I highlight the columns that have a matching number in each of the columns on each row?? For the columns that have mismatched numbers, leave the cells as is.

    See the example...

    Thanx...LT
    Attached Files Attached Files

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Highlight the cells that match??

    Hi,

    See attached using conditional formatting. I selected C3:AH18 and then in conditional formatting used the formula: =COUNTIF(C$3:C$18,MODE(C$3:C$18))=16 and then set the format.

    Dom
    Attached Files Attached Files
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  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: Highlight the cells that match??

    weird way of looking at subnets
    but

    select c3:ah18
    apply conditional format of
    =OR(SUM(C$3:C$18)=16,SUM(C$3:C$18)=0)
    Attached Files Attached Files
    "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 Contributor
    Join Date
    06-29-2005
    Location
    TN
    MS-Off Ver
    Microsoft 365
    Posts
    327

    Re: Highlight the cells that match??

    Thank you guyz.....both versions work pretty good. Now....can we take 1 step further?
    On the Subnet Mask row...for each column that has a match, we insert a "1", for each column that DOES NOT match, we insert a "0". Is that possible?? I was trying to come up with a math formula...kinda stumped.

    This is more for route summarization than for subnetting.

    Thanx again....LT

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Highlight the cells that match??

    Expanding Martin's formula a little should do it: =OR(SUM(C$3:C$18)=16,SUM(C$3:C$18)=0)*1

    Dom

  6. #6
    Forum Contributor
    Join Date
    06-29-2005
    Location
    TN
    MS-Off Ver
    Microsoft 365
    Posts
    327

    Re: Highlight the cells that match??

    Quote Originally Posted by Domski View Post
    Expanding Martin's formula a little should do it: =OR(SUM(C$3:C$18)=16,SUM(C$3:C$18)=0)*1

    Dom
    That didn't work very well, for the columns that did not match all the numbers, it put in a "1", and it needs to be a zero.
    Columns with a match = "1"
    Columns with a mismatch = "0"

    I was trying an IF statement. Being that the only numbers used in a calculation is either a 1 or a zero. If I multiply each number by the next one, I'll come up with a 1 or a zero.
    Then using an IF statement, if the result is a "1", insert a "1", if the result is a zero, insert a "1". This is only for the subnet mask row.

    Thanx...LT

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Highlight the cells that match??

    Works okay for me.

    Dom
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-29-2005
    Location
    TN
    MS-Off Ver
    Microsoft 365
    Posts
    327

    Re: Highlight the cells that match??

    Was just thinking about my IF statement, don't think that will work right, for the columns that do not match, the end result must = 0.

  9. #9
    Forum Contributor
    Join Date
    06-29-2005
    Location
    TN
    MS-Off Ver
    Microsoft 365
    Posts
    327

    Re: Highlight the cells that match??

    Found a malfunction(s). Your example works pretty good, Thank You. If I use 16 network statements, it works good, if I use less than 16 networks, it doesn't work at all. They'll be cases where I may need to summarize only 4 networks, or 6, or 8, etc..

+ 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