+ Reply to Thread
Results 1 to 13 of 13

Highlighting Rows where Data is Duplicated in More than One Cell

  1. #1
    Registered User
    Join Date
    06-21-2018
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Highlighting Rows where Data is Duplicated in More than One Cell

    Hi there,

    Struggling to find an answer to this on Google, or perhaps just struggling to phrase the question correctly.

    I have a spreadsheet with a lot of data, and I need to identify rows that are duplicate entries. In order to do this I need to be able to highlight any row where data in Column A and data in Column B is identical.

    There are many instances where data in just one of the columns would be duplicated, but it wouldn't necessarily be a duplicate entry unless both columns have the same data.

    Can anyone give me a solution to this issue?

    Many thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    any row where data in Column A and data in Column B is identical.
    Do you mean that in that row, the value in column A is the same as the value in column B?

    This can be done with conditional formatting. But I'm not sure I understand your description, because
    There are many instances where data in just one of the columns would be duplicated
    Now it sounds like you are checking to see if data in that row appears in another row.

    So can you define more clearly your definition of what you want to highlight? A concrete example would be best, and the best of all would be to attach a file with an example showing the result you want.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Hello Beese,

    Welcome to the Forum!

    You could use Conditional Formatting, as shown in the attached sample Workbook.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    @ 6StringJazzer,

    Hi Jeff,

    Its been a while since we have had contact. The OP also states;
    There are many instances where data in just one of the columns would be duplicated, but it wouldn't necessarily be a duplicate entry unless both columns have the same data.
    Or am I missing something?

    Regards.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Quote Originally Posted by Winon View Post
    @ 6StringJazzer,

    Hi Jeff,

    Its been a while since we have had contact. The OP also states;

    Or am I missing something?

    Regards.
    Well, that is exactly the thing that is throwing me. Are we looking for data in column A that is duplicated in column A and also data in column B that is duplicated in column B and also the data in columns A and B match? I don't know if that's the question. It seems that column A matching column B is necessary but not sufficient.

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    @ JLGWhiz,

    If you want to use VBA instead of the built in Excel Conditional Formatting, then this will work;

    Please Login or Register  to view this content.
    As opposed to your formula;
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards.

  8. #8
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Quote Originally Posted by Winon View Post
    @ JLGWhiz,

    If you want to use VBA instead of the built in Excel Conditional Formatting, then this will work;

    Please Login or Register  to view this content.
    As opposed to your formula;
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards.
    I didn't get the same results. It only identified items where column A matched column B. I think the OP wanted to find duplicates where count of column A value is greater than 1 and the value in column B is the same as the value in the first occurrence column B value. In otherwords, Column A and B might not be the same value but the concatenated values of the two could be the same on more than one row. But you are correct that it could be done with CF.

    But maybe I read the OP wrong.
    Last edited by JLGWhiz; 06-21-2018 at 02:00 PM.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    @ JLGWhiz,

    Your assumption may be correct, but I found that your Code, erases the Data in Column A on completion.

    Regards.

  10. #10
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Quote Originally Posted by Winon View Post
    @ JLGWhiz,

    Your assumption may be correct, but I found that your Code, erases the Data in Column A on completion.

    Regards.
    Yes, it deletes the helper column that was added at the beginning of the macro, but it does not delete any of the original data.

    It woud be nice if the OP would respond and let us know what they really want.
    Last edited by JLGWhiz; 06-21-2018 at 06:37 PM.

  11. #11
    Registered User
    Join Date
    06-21-2018
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Hi guys,

    Many thanks for your replies. I'm sorry I wasn't entirely clear with what I was trying to achieve.

    I'll make an example:

    Excel_Example.JPG

    I've highlighted the rows that I would want my formatting to bring up. In these rows there is a duplication of the data in Column B and Column C.

    Row 2 and 11 have the same data in Column B, but not Column C. Likewise, Rows 2 and 8 have the same data in Column C, but not B.

    Essentially, I am trying to identify where our systems have clients duplicated across multiple entries. Obviously there are going to be lots of people with the same surname and people who have the same postcode, but that probably wouldn't mean that they were the same household. However, where the postcode and surname are both the same, it's quite likely that this is the same household (even if it's a different person in said household).

    If I can get these rows highlighted, then I can do a manual check to determine if the entries can be collated.

    I hope that clears things up.

    Thanks

  12. #12
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    Then Post #6 will work with changes to accomodate the column layout in your screen shot.
    Please Login or Register  to view this content.

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Highlighting Rows where Data is Duplicated in More than One Cell

    The way I would word this is to highlight any rows where the combination of column B and column C are duplicated in other rows.

    The simplest way to do this is with conditional formatting:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Sample attached. I didn't take the time to type in your actual post codes (I suggest you attach a file instead of an image next time) but otherwise matches your examples.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Highlighting duplicated values with two compound conditions
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2017, 04:04 PM
  2. Highlighting data that is less than a specific cell by rows
    By kelly.barlow in forum Excel General
    Replies: 3
    Last Post: 10-26-2016, 08:22 AM
  3. [SOLVED] where cell data duplicated copy rows to new sheet
    By shaz0503 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2013, 05:54 PM
  4. Highlighting duplicated values
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-03-2013, 11:51 PM
  5. Highlighting duplicates based on how many times they're duplicated
    By aking in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 08-19-2012, 08:41 AM
  6. Replies: 6
    Last Post: 08-18-2012, 05:00 AM
  7. Replies: 6
    Last Post: 07-20-2012, 10:57 AM

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