+ Reply to Thread
Results 1 to 7 of 7

find duplicates in A and C columns, copy D column content of C duplicate's row to A's B ?

  1. #1
    Registered User
    Join Date
    01-13-2012
    Location
    Mongolia
    MS-Off Ver
    Excel 2007
    Posts
    15

    find duplicates in A and C columns, copy D column content of C duplicate's row to A's B ?

    Sorry for my stupid title. I have no knowledge of vba, though I was able to execute VBA commands advised from this forum, for which I thank a lot.

    Is there a way to find duplicates in different columns or sheets (for example: staff id, in A and C column), then copy what is in the right column of C column duplicate's row (i.e. work hour) and paste it to the right of the duplicate in A column? When this is done, I will delete C and D column. This continues for 1000's of rows. The same process is going to applied to other performance indicators of staff. Thank you all in advance, for your feedback.

    before1.png

    after.png

    final.png

    Book3.xlsx
    Last edited by zori2012; 01-29-2015 at 02:11 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,701

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Instead of picture attach a sample workbook

    Also confirm whether staff id needs to be matched for Column-C alone or some other columns like column-E will also have the staff id?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,543

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Hi Zori,

    No problem if you use VLookup. See the attached with the formula of:
    =IFERROR(VLOOKUP(A3,$C$1:$D$13,2,FALSE),"")

    and then copy it down to the bottom of your data.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    01-13-2012
    Location
    Mongolia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Sixthsense, thank u. I attached a sample workbook.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,701

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Quote Originally Posted by zori2012 View Post
    Sixthsense, thank u. I attached a sample workbook.
    I don't see any special reason for doing it in VBA code since it can be simply arrived using Worksheet Functions.

    So please use the solution provided by MarvinP in Post #3

  6. #6
    Registered User
    Join Date
    01-13-2012
    Location
    Mongolia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Quote Originally Posted by MarvinP View Post
    Hi Zori,

    No problem if you use VLookup. See the attached with the formula of:
    =IFERROR(VLOOKUP(A3,$C$1:$D$13,2,FALSE),"")

    and then copy it down to the bottom of your data.
    Hi Guru MarvinP,

    It works really great. Thank you very much. My hat is off to you.

  7. #7
    Registered User
    Join Date
    01-13-2012
    Location
    Mongolia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: find duplicates in A and C columns, copy D column content of C duplicate's row to A's

    Quote Originally Posted by :) Sixthsense :) View Post
    I don't see any special reason for doing it in VBA code since it can be simply arrived using Worksheet Functions.

    So please use the solution provided by MarvinP in Post #3
    Hi Sixthsense, yeah, I even don't know whether vba or function would do the work. Anyway, thank you guys for your help.

+ 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 in one column & add data from another column to duplicate-free sheet
    By ingiabouzeid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2013, 03:37 AM
  2. [SOLVED] Macro to find column with duplicates, for each of those check another column for duplicate
    By MaartenKoller in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2013, 10:09 AM
  3. [SOLVED] Find Duplicates and remove the duplicate entry comparing two columns
    By retrospikz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2013, 03:17 AM
  4. [SOLVED] Find Duplicates, check value in another column for each duplicate
    By labrooy in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-09-2012, 06:57 PM
  5. find duplicates, and copy the first duplicate
    By Caseyv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2010, 10:56 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