+ Reply to Thread
Results 1 to 2 of 2

Need VBA to replace this formula for grouping duplicates

  1. #1
    Registered User
    Join Date
    01-11-2016
    Location
    West Bend
    MS-Off Ver
    2013
    Posts
    1

    Need VBA to replace this formula for grouping duplicates

    My problem is I have data in Columns, C, D, E, F and if there are duplicates anywhere within each one of these columns they need to be grouped together. I created an index# column in column G and the formula below works for it however I cant make it any longer and I will have to do more columns. Hopefully the below example helps. Let me know if anyone can help.

    C D E... G (Index#)
    1 2 3 1
    1 222 33 1
    11 33 1
    111 22 3333 2
    1111 2222 333 3
    11111 22222 3 1

    Formula in G2

    =IF(COUNTIF(F$2:F2,F2)>1,VLOOKUP(F2,F$1:G1,2,0),IF(COUNTIF(E$2:E2,E2)>1,VLOOKUP(E2,E$1:G1,3,0),IF(COUNTIF(D$2:D2,D2)>1,VLOOKUP(D2,D$1:G1,4,0),IF(COUNTIF(C$2:C2,C2)>1,VLOOKUP(C2,C$1:G1,5,0),MAX(G$1:G1)+1))))
    Last edited by derickfrederick; 10-04-2019 at 01:02 PM. Reason: Add image

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Need VBA to replace this formula for grouping duplicates

    Please will you prepare and attach an Excel sample of your data.
    - Battle without fear gives no glory - Just try

+ 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 duplicates and replace
    By Kshitij Tyagi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2018, 07:35 AM
  2. [SOLVED] Combining duplicates and grouping unique values
    By RaydenUK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2015, 03:20 PM
  3. Grouping Duplicates...
    By kholland in forum Excel General
    Replies: 5
    Last Post: 06-29-2012, 03:42 PM
  4. [SOLVED] Grouping of duplicates in a column.
    By teja in forum Excel General
    Replies: 2
    Last Post: 05-11-2012, 05:32 PM
  5. Grouping Duplicates
    By shanicelong in forum Excel General
    Replies: 0
    Last Post: 08-03-2011, 04:25 PM
  6. Replace duplicates with zero
    By k2010 in forum Excel General
    Replies: 5
    Last Post: 08-27-2010, 02:46 AM
  7. Replies: 1
    Last Post: 07-13-2010, 10:09 AM

Tags for this Thread

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