+ Reply to Thread
Results 1 to 9 of 9

Formula to find duplicate values in one column

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Formula to find duplicate values in one column

    Hello
    Apologies if this has been posted before.
    I have a long spreadsheet of data with name and surname in one column (column A). What is the easiest way to find duplicate names and surnames in that column?
    If posted before, could you pls fwd me the link?
    Thank you
    Last edited by Dogmia78; 08-18-2016 at 02:08 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to find duplicate values in one column

    =IF(COUNTIF($A$2:$A$15,A2)=1,FALSE,NOT(COUNTIF($A$2:A2,A2)=1))

    used as a conditonal formatting formula should highlight all duplicates (2nd and subsequent occurrences). If that is't what you need, then please be more exact in your description!
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to find duplicate values in one column

    Maybe something like this...

    Data Range
    A
    B
    1
    Header
    Header
    2
    Name1
    3
    Name1
    Dup
    4
    Name7
    5
    Name7
    Dup
    6
    Name5
    7
    Name7
    Dup
    8
    Name1
    Dup
    9
    Name4
    10
    Name4
    Dup


    This formula entered in B2 and copied down:

    =IF(ROW()<>MATCH(A2,A:A,0),"Dup","")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Thumbs up Re: Formula to find duplicate values in one column

    Hello both

    Thank you for a prompt reply. Tony's formula worked, although it did not highlight cells, Glenn's for some reason didn't (it highlighted random names that did not have duplicates).


    Thank you both for your help

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to find duplicate values in one column

    Odd. It was working OK in the attached file. did you adjust the formula ranges to suit your actual data?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to find duplicate values in one column

    If you would rather have the duplicates highlighted...

    Data Range
    A
    1
    Header
    2
    Name1
    3
    Name1
    4
    Name7
    5
    Name7
    6
    Name5
    7
    Name7
    8
    Name1
    9
    Name4
    10
    Name4


    Select the ENTIRE range A2:A10 starting from cell A2.
    Cell A2 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Goto the Home tab>Styles>Conditional Formatting>
    Manage rules>New rule>Use a formula to determine
    which cells to format

    Enter this formula in the box below:

    =ROW()<>MATCH(A2,A:A,0)

    Click the Format button
    Select the desired fill color
    OK out

  7. #7
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4
    Hello again

    I have re-run Glenn's formula and it is working now.
    Tony, this is also really helpful.

    Thanks again guys.


    Quote Originally Posted by Tony Valko View Post
    If you would rather have the duplicates highlighted...

    Data Range
    A
    1
    Header
    2
    Name1
    3
    Name1
    4
    Name7
    5
    Name7
    6
    Name5
    7
    Name7
    8
    Name1
    9
    Name4
    10
    Name4


    Select the ENTIRE range A2:A10 starting from cell A2.
    Cell A2 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Goto the Home tab>Styles>Conditional Formatting>
    Manage rules>New rule>Use a formula to determine
    which cells to format

    Enter this formula in the box below:

    =ROW()<>MATCH(A2,A:A,0)

    Click the Format button
    Select the desired fill color
    OK out

  8. #8
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4
    Hi
    I have re-run it and works perfectly now.
    Thank you again😊
    Quote Originally Posted by Glenn Kennedy View Post
    Odd. It was working OK in the attached file. did you adjust the formula ranges to suit your actual data?

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to find duplicate values in one column

    You're welcome. Thanks for the feedback!

+ 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. Find Duplicate in one column then compare to values in another
    By cooper.1651 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2015, 12:10 PM
  2. How to find duplicate values in another column
    By JessK in forum Excel General
    Replies: 2
    Last Post: 06-16-2014, 09:11 AM
  3. Replies: 7
    Last Post: 05-28-2014, 03:19 AM
  4. Find duplicate values for unique column
    By zammy73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2014, 06:45 PM
  5. [SOLVED] Macro to find duplicate values in a column and add the corresponding rows
    By hoss88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2013, 05:40 AM
  6. Find duplicate values in a column, make each value unique.
    By jobell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 12:15 PM
  7. How can I find duplicate values in a column and then change the value of a cell?
    By Excelcod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2011, 02:59 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