+ Reply to Thread
Results 1 to 4 of 4

Comparing Common Values and Copying Data Between Worksheets

  1. #1
    Registered User
    Join Date
    01-08-2010
    Location
    Benson, NC
    MS-Off Ver
    Excel 2003
    Posts
    3

    Comparing Common Values and Copying Data Between Worksheets

    I've got two Excel worksheets for our customers, both of which contain information I need but neither of which has all of the information. There are also some customers on one spreadsheet that are not in the other.

    What I'd like to do is to compare a common value between the two Worksheet 1 & Worksheet 2 (i.e. Customer_ID#). If the first customer ID in WS1 matches the first Customer ID in WS2, certain information (i.e.: Sales) is copied from one spreadsheet to another. If it is not a match, the next Customer ID in WS2 is checked, and so on. If there are no matches to a particular Customer ID, the SALES column is left blank (or placeholder text is entered).

    Because of the different number of rows in the 2 sheets, a simple sort won't work. I've tried an "If...Then" function, but I can't figure out how to perform the function on all of the records (instead of just one) and how to make it increment while comparing.

    I've attached a sample workbook that has samples. (The actual sheets have several hundred entries.)

    Am I asking for two much? It sounds simple to do, but I'm not well versed in Excel programming.

    Any assistance would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Comparing Common Values and Copying Data Between Worksheets

    If I understand correctly, try this in D2 and copied down:

    =IF(ISNA(VLOOKUP(A2,Customer_Sales!$A$2:$C$23,3,FALSE)),"No match",VLOOKUP(A2,Customer_Sales!$A$2:$C$23,3,FALSE))

  3. #3
    Registered User
    Join Date
    01-08-2010
    Location
    Benson, NC
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Comparing Common Values and Copying Data Between Worksheets

    This works for the sample spreadsheet I attached, but when I try to apply it to the actual one (which does have a few more columns), it doesn't seem to work. Admittedly, I thought I'd be able to simply plug in the actual cell names/locations, but I must be missing something.

    I think I understand what most of the formula is doing, but the "3" reference throws me off. Here is the formula I tried ...

    =IF(ISNA(VLOOKUP(A2,HONDA_SALES!$A$2:$O$2001,3,FALSE)),"No match",VLOOKUP(A2,HONDA_SALES!$A$2:$O$2001,3,FALSE))

    The two common columns are both A2, and the worksheet range that has the sales figures I'm trying to copy is A2:O2001.

  4. #4
    Registered User
    Join Date
    01-08-2010
    Location
    Benson, NC
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Comparing Common Values and Copying Data Between Worksheets

    I actually figured it out. By changing the "3" to the appropriate column from which I needed to return value, it worked like a charm.

    Thanks Stephen R!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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