+ Reply to Thread
Results 1 to 10 of 10

Compare values from 2 colums and highlight only repeated values

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Singapore
    MS-Off Ver
    MS Office 365 Business
    Posts
    5

    Compare values from 2 colums and highlight only repeated values

    Compare values from 2 colums and highlight only repeated values in col A.

    EG:
    Col A Col B
    1001 1001
    1001 1001
    1001

    Only the first 2 will be highlighted in Col A.
    I'm trying to compare physical stocks on hand against those in my system.

    Thank you in advance for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Compare values from 2 colums and highlight only repeated values

    just use a conditional formatting rule
    Select column A

    use a formula for the conditional formatting rule

    =$A1=$B1

    that will also highlight all the blank cells - so to avoid that

    =AND(A1=B1,OR(A1<>"",B1<>""))

    then if the cell A or B is blank - it will be ignored
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    02-27-2019
    Location
    Singapore
    MS-Off Ver
    MS Office 365 Business
    Posts
    5

    Re: Compare values from 2 colums and highlight only repeated values

    Hi etaf,

    Thank you so much for replying!

    But when I include more values to test, it all got highlighted.

    Attached is my working file.
    Attached Files Attached Files

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Compare values from 2 colums and highlight only repeated values

    just us
    =AND(A1=B1,OR(A1<>"",B1<>""))

    not both formulas

  5. #5
    Registered User
    Join Date
    02-27-2019
    Location
    Singapore
    MS-Off Ver
    MS Office 365 Business
    Posts
    5

    Re: Compare values from 2 colums and highlight only repeated values

    Hi etaf,

    Sorry, I'm not sure where I'm doing it wrong but its still not showing the results in the "after"..

    Sorry about that..
    Attached Files Attached Files

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Compare values from 2 colums and highlight only repeated values

    that looks OK when I open it
    What are you after

    Before
    Cell highlighted are A2 , A3 , A8
    which is correct as they match the same value in cells B2, B3 , B8

    or did you want something different in the After Sheet?

  7. #7
    Registered User
    Join Date
    02-27-2019
    Location
    Singapore
    MS-Off Ver
    MS Office 365 Business
    Posts
    5

    Re: Compare values from 2 colums and highlight only repeated values

    Hi etaf,

    What I'm looking for is if there are three "1001" in column B, three "1001" should be highlighted in column A.

    Following the formula, only 2 got highlighted in column A instead of 3.

    Thank you for your time!

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Compare values from 2 colums and highlight only repeated values

    thanks so thats different to what I thought you had asked originally

    try
    =AND(A1<>"",COUNTIF($A$1:A1,A1)<=COUNTIF($B:$B,A1))
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-27-2019
    Location
    Singapore
    MS-Off Ver
    MS Office 365 Business
    Posts
    5

    Re: Compare values from 2 colums and highlight only repeated values

    Hi etaf!

    Thank you so much! My problem has been solved!!!

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Compare values from 2 colums and highlight only repeated values

    you are welcome

+ 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. Highlight values that are repeated more than twice
    By amirsalamat in forum Excel General
    Replies: 10
    Last Post: 08-21-2016, 12:20 AM
  2. Replies: 6
    Last Post: 07-25-2016, 12:07 PM
  3. Replies: 1
    Last Post: 10-11-2014, 04:52 AM
  4. Compare values in two colums
    By p3x935 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-30-2014, 12:32 PM
  5. Compare values from two or more sheets, leave only non repeated values
    By reynierpm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2013, 01:35 PM
  6. [SOLVED] Compare Colums and Color enire row if values (text) do not match
    By GatorsBucs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-27-2013, 11:43 AM
  7. [SOLVED] Need to compare values in two colums and delete accordingly
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2006, 05:20 PM

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