+ Reply to Thread
Results 1 to 5 of 5

Comparing Same Column to Column for Matches and then Comparing Offset Values

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Comparing Same Column to Column for Matches and then Comparing Offset Values

    Hello,

    Hope someone could help me with this one. I am comparing a range in one column to the same column for identical matches and then if there are any matches, I am then comparing the next column over to see if the value is lower, higher, or the same.

    I think I am close but I also think that my issue is that the initial data is being compared to itself which would mean I need to exclude the active data in my first range. I am not sure how to do this and actually I am not sure this is the only problem with what I have so far. The macro is needed to compare document numbers and revisions to determine which are duplicates and then which are older and newer.

    Here is what I have so far:

    Please Login or Register  to view this content.
    Here is an example of data in excel:

    Document Name Document Revision Dup Comparison Example (What Column C should output)
    DOC-XX-001 0 Duplicate (Same Rev)
    DOC-XX-001 0 Duplicate (Same Rev)
    DOC-XX-002 0 Duplicate (Lower Rev)
    DOC-XX-002 1 Duplicate (Lower Rev)
    DOC-XX-002 2 Duplicate (Lower Rev)
    DOC-XX-002 3 Duplicate (Lower Rev)
    DOC-XX-002 4 Duplicate (Higher Rev)
    DOC-XX-003 1 Duplicate (Higher Rev)
    DOC-XX-003 0 Duplicate (Lower Rev)
    DOC-XX-004 0 Duplicate (Lower Rev)
    DOC-XX-004 3 Duplicate (Higher Rev)
    DOC-XX-004 0 Duplicate (Lower Rev)

    Eventually I will add in a function to move anything that is the lowest revision or the additional same revisions to another speadsheet as I am only interested in keeping the highest revisions. Anyway, any help would be much appreciated.

    Thank you

  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: Comparing Same Column to Column for Matches and then Comparing Offset Values

    Hi,

    Why use a macro when a normal formula could do the same thing?
    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
    Registered User
    Join Date
    08-15-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Comparing Same Column to Column for Matches and then Comparing Offset Values

    Hi Richard,

    I guess I didn't consider using a formula as I already had a macro for the document comparison and now I am trying to add in the revision comparison as well. Would a formula be faster or maybe there is something in a formula that I cannot do in a macro? Thanks for the reply and I would absolutely be open to using a formula or any suggestions if it could achieve what I need.

  4. #4
    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: Comparing Same Column to Column for Matches and then Comparing Offset Values

    Hi,

    Almost without exception formulae are faster than any VBA code.
    If you'd like to upload your workbook, anonymised if necessary then no doubt we can advise further. Also manually add examples of the results you expect to see and tell us where the results are and explain the calculations/rules/processes you have used to obtain the results.

  5. #5
    Registered User
    Join Date
    08-15-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Comparing Same Column to Column for Matches and then Comparing Offset Values

    Thanks again but I was able to exclude the active compare string by simply changing it to nothing during the y comparison. Did exactly what I was asking for by excluding the active compare string temporarily.

+ 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. Replies: 19
    Last Post: 03-15-2014, 04:50 PM
  2. Replies: 3
    Last Post: 10-15-2012, 10:42 AM
  3. Comparing values in a column
    By Redsox in forum Excel General
    Replies: 1
    Last Post: 07-03-2012, 09:52 PM
  4. Comparing column values?
    By matrixknow in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2007, 04:09 AM
  5. comparing values and returning different column
    By JustMe602 in forum Excel General
    Replies: 12
    Last Post: 06-01-2007, 11:40 AM
  6. comparing column values
    By gall in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-26-2006, 01:55 PM
  7. Comparing 2 column for matches
    By IFIXPCS in forum Excel General
    Replies: 0
    Last Post: 02-22-2006, 11:15 AM
  8. Comparing column values
    By Mark Christensen in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 02:50 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