+ Reply to Thread
Results 1 to 9 of 9

Compare three columns of data to see what is a duplicate and what is not

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Compare three columns of data to see what is a duplicate and what is not

    Hello, I have three different rows of data in an excel spreadsheet:
    ||All Forms||Forms Used 2011||Forms Used 2012||
    ||FormA||FormE||FormC||
    ||FormB||FormA||FormD||
    ||FormC||FormC||FormG||
    ||FormD||FormZ||FormY||

    The "All Forms" column has all the different types of forms that exist, whereas the other two columns have a list of forms used in 2011 and 2012. None of the columns are in order or anything (and the data from column A doesn't correspond with the data in column B, etc)

    I want to ideally make it so that the 2011 and 2012 columns 'line up' with the "All Forms" column (basically making it so that if a form was not used in 2011 or 2012, that cell would show up blank in the 2011 or 2012 row that corresponds to the "All Forms" row).

    Basically, I'm trying to get something like this:
    ||All Forms||Forms Used 2011||Forms Used 2012||
    ||FormA||FormA||(blank)||
    ||FormB||FormB||FormB||
    ||FormC||(blank)||(blank)||
    ||FormD||FormD||(blank)||

    Above, row 2 would indicate that FormA wasn't used in 2012.
    Row 3 would indicate that FormB was used in both 2011 and 2012.
    Row 4 would indicate that FormC wasn't used in 2011 or 2012.
    Row 5 would indicate that FormD wasn't used in 2012.


    Is there any way to do this?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Compare three columns of data to see what is a duplicate and what is not

    Hi,

    Your explanation does not seem consistent with your (albeit small) 4 result rows.

    i.e. Form B (row 3) only exists in 2011
    Form C (row 4) does exist in 2011
    Form D (row 5) was used in 2012

    Can you clarify
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Compare three columns of data to see what is a duplicate and what is not

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    06-07-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Compare three columns of data to see what is a duplicate and what is not

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Your explanation does not seem consistent with your (albeit small) 4 result rows.

    i.e. Form B (row 3) only exists in 2011
    Form C (row 4) does exist in 2011
    Form D (row 5) was used in 2012

    Can you clarify
    My apologies, I meant to put "etc." at the bottom. In the spreadsheet, there are thousands of rows. Anything in the 2011 and 2012 columns will be in the "All Forms" column.

  5. #5
    Registered User
    Join Date
    06-07-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Compare three columns of data to see what is a duplicate and what is not

    Quote Originally Posted by MickG View Post
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick
    I get a Runtime Error 424, Object required. It highlights the following line:
    If Ray(R, 2) <> "" Then .Item(Ray(R, 2)).Offset(, 2) = Ray(R, 2)

  6. #6
    Registered User
    Join Date
    06-07-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Compare three columns of data to see what is a duplicate and what is not

    If you want to do this without any code, use a vlookup funtion. Attached is an example I did using your template, it should be pretty self explanatory but let me know if you have questions.
    vlookup example.xlsx

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Compare three columns of data to see what is a duplicate and what is not

    There's a workbook that will do this at https://www.box.com/shared/elrnbidnr7.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    06-07-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Compare three columns of data to see what is a duplicate and what is not

    Quote Originally Posted by brandonlaw View Post
    If you want to do this without any code, use a vlookup funtion. Attached is an example I did using your template, it should be pretty self explanatory but let me know if you have questions.
    Attachment 161155
    The vlookup function actually worked perfectly! Wasn't aware of its functionality, thanks!

  9. #9
    Registered User
    Join Date
    06-07-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Compare three columns of data to see what is a duplicate and what is not

    Quote Originally Posted by instinctellekt View Post
    The vlookup function actually worked perfectly! Wasn't aware of its functionality, thanks!
    No problem. It's a great funtion to know, saves TONS of time. I'm not great with excel, but Vlookup saves me hours of work constantly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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