+ Reply to Thread
Results 1 to 6 of 6

Locating Duplicate Cell Data with a Cell Counter and Highlight

  1. #1
    Forum Contributor garrett.grillo's Avatar
    Join Date
    06-19-2011
    Location
    San Francisco, California
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    191

    Locating Duplicate Cell Data with a Cell Counter and Highlight

    Hi Excel Forum Team,

    I wanted to find out, I have about 5000 server names that I’m totaling up. Some of those server names are duplicates, but their hard to locate and to count up how many duplicates there are. So I have two questions to ask.

    Question 1)
    Is there an equation or way to make a counting cell that will locate duplicate information in a range of cells and thus provide a total number for all the duplicates it was able to locate?

    Example:
    Cell A1 is the duplicate counting equation cell.
    Cells A2 thru. A6 are your data range cells containing your 5 server names.
    Cells A3 & A5 have duplicate server names, A2 & A6 have duplicate server names and cell A4 does not have a duplicate server name.
    So, cell A1 (equation cell) would only count the duplicate server names and equal a total of 2.

    Question 2)
    Given a the same range of cells, is there a way for excel to automatically highlight the cell(s) in one color (green) for non-duplicate cells and recognize duplicate cells in another color (yellow)

    Thank for taking the time in reading my request and help.

    Garrett
    Last edited by garrett.grillo; 04-29-2012 at 10:11 PM. Reason: Making the question clearer

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Locating Duplicate Cell Data with a Cell Counter and Highlight

    I know your data range is much longer than this, so adjust as required.

    assume your data range is L13:L19, in M13, add this formula, and copy down. please take note of the absoluting ($)...

    =IF(ISERROR(VLOOKUP(L13,L14:$L$19,1,FALSE)),"",L13)

    Then apply filters and use that column to select all non-blanks. that will give you a list of all duplicates

    edit:

    to have a running total of all duplicates, change the formula to...
    =IF(ISERROR(VLOOKUP(L14,L15:$L$19,1,FALSE)),"",MAX($M$13:M13)+1)
    Last edited by FDibbins; 04-29-2012 at 10:48 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Locating Duplicate Cell Data with a Cell Counter and Highlight

    If I were approaching this one, I would apply a unique values filter via Data Tab >> Sort & Filter Group >> Advanced. I would then select my range >> Copy to a New Location >> Specify the location to be pasted, enable Unique Values Only and create my list. My 'Count' of the duplicates would then be one less than the offset COUNTIF.

    See Attached. ServerNameExample.xlsm
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  4. #4
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: Locating Duplicate Cell Data with a Cell Counter and Highlight

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sa DQ; 04-30-2012 at 01:23 AM.

  5. #5
    Forum Contributor garrett.grillo's Avatar
    Join Date
    06-19-2011
    Location
    San Francisco, California
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    191

    Re: Locating Duplicate Cell Data with a Cell Counter and Highlight

    Hi Sa Dq,

    Can you explain how the macros work in the spreadsheet you attached?

    Thank You,
    Garrett

  6. #6
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Exclamation Re:I can not, because my english is too bad

    See #4 post:

    1:= Rng.Address: Range("A1:B6395")
    2:= Rws = 6395
    3:= Rng.Address: Range("B1:B6395")
    4:= Set BackColor of Rng = 0
    5:= Methode AdvancedFilter Rng => [AA] column
    6..18 For. . Next with Range in [AA2:AA6291]
    7:= Methode FIND() With cell in [AA2:AA6291]
    8:= If yes, then. . . (to 17 End If)
    9:= MyAdd = sRng.Address (ln 16)
    11:= Do. . Loop (ln 16)
    12:= jJ Count times duplicate
    13:= Count duplicate ID
    14:= Set backColor in cell for duplicate
    15:= FindNext (If . . .)
    16:=Loop . . . .
    19:= Add duplication value to [D2]

+ 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