+ Reply to Thread
Results 1 to 11 of 11

Compare Columns and Display Results

  1. #1
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Compare Columns and Display Results

    Hello,

    I would like to Compare Col A & B with Col C & D.

    If the contents of Col A (format could be numbers, text, general) match Col C (in any format), then print Col A & B and C & D in another location next to each other.

    If Col A does not match Col C (from C1, C2 to infinity), print Col A and the words "no match" next to it.

    I need to check the contents of A1 with the contents of C1, C2 to infinity, then A2 will check C1, C2 to infinity until each row of Col A has been checked against each row of Col C.

    CORRECTION OF DESCRIPTION APPEARS BELOW

    Thanks for your help
    Last edited by punkin44; 11-04-2014 at 04:19 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Compare Columns and Display Results

    I am not clear on what you want the result to look like, especially this: "print Col A & B and C & D in another location next to each other. "

    But part of the solution is this formula, which for any row will tell you if the value in column A of that row can be found anywhere in column C:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It would be helpful to attach a file with a small sample of what you want this to look like.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Thanks for your help. I have prepared a sample input and output on an excel sheet, but do not see how to attach a file.

  4. #4
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Hi,

    Here is the attachment sample.

    Thank you
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    CORRECTION OF DESCRIPTION APPEARS BELOW

    Using A1 search for matching number in C1 through infinity, when completed use A2 and repeat comparing C1 through infinity.

    When match found between Col A and Col C (for example A1 and C1), compare contents of B1 with D1. If match between B1 with D1, print A1, B1 and C1, D1 next to each other to show a match was found.

    If A1 contents not found in Col C, print A1, B1 and "NO MATCH HEADER"

    If match found between A1 and C1, but B1 does not match D1 print A1, B1 and "Value NOT FOUND"

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare Columns and Display Results

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Thanks John, so do I just insert the code in any cell, populate ABC and D and that's it? Do I have to put the code in some special place and press something to get it to go? Thank you
    Last edited by punkin44; 11-04-2014 at 08:56 AM.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare Columns and Display Results

    It's a macro. Go to your developers tab. VB Editor. Insert Module and place the code there. Results will go to FGHI columns.

  9. #9
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Thank you. I have to go to work, will advise round 1 pm est thanks for your help.

  10. #10
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Hi John,

    Please see the attachment. Thank you
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-29-2014
    Location
    New York
    MS-Off Ver
    2007
    Posts
    33

    Re: Compare Columns and Display Results

    Hi,

    Can you tell me what I did not do correctly?

    Thanks

+ 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: 0
    Last Post: 10-21-2014, 06:52 AM
  2. Compare two columns in one woorkbook, bounce results off of a different workbook.
    By goldenr1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2010, 12:19 AM
  3. How to compare two columns and filter results ?
    By ASP__DEVELOPER in forum Excel General
    Replies: 8
    Last Post: 04-17-2010, 11:00 PM
  4. compare two columns and display a third
    By ch90 in forum Excel General
    Replies: 4
    Last Post: 10-13-2005, 08:05 AM
  5. Compare columns & Display Differences
    By Pauldls in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2005, 08:00 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