+ Reply to Thread
Results 1 to 7 of 7

Align matching columns, then copy and paste data from one cell into another

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Arkansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Align matching columns, then copy and paste data from one cell into another

    Hello all,

    I'm very new to the forums, but I've been working with Excel quite a bit at work and I've realized that I don't know much about it.I'm hoping that you all can help me with something that I'm currently stuck on.

    Columns A and B contain 7-to-8-digit sequences (such as 12345677, 12345678,12345679, etc). Column A has some numbers that are not in Column B, and Column B has some numbers that are not in Column A. However, most of the numbers should have a pair.

    Column C has numbers 0-300.

    I need to set up a function that will basically align the matching numbers for Columns A and B, then it should copy the number from Column C (if the numbers in A and B are matching) and paste it in Column P.

    Any help would be greatly appreciated!

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Align matching columns, then copy and paste data from one cell into another

    Hi Allisaursus,

    It sounds like you will need a macro to do it, but I'm confused as to how the value of column C is determined if the corresponding values in Columns A and B are on different rows. Are the numbers between A and B sequential, just A is missing some in the sequence and B is missing some others in the same sequence so they become misaligned?

    Thanks,

    Daniel

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Align matching columns, then copy and paste data from one cell into another

    Hi Allisaurus and welcome to the forum

    if i understand you correctly, (most of) the values in A exist in B, but not necessarily on the same row? and then, next to each pair of numbers, you have another value (0-300)

    which of the columns (A or B) does the value (0-300) belong to?

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    01-03-2013
    Location
    Arkansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Align matching columns, then copy and paste data from one cell into another

    Thank you for your replies!

    I apologize for my confusing post. I typed it in a hurry and did not realize that I was missing some important information (and also that some of my information was incorrect), so let me try to explain it again. I've also attached an example spreadsheet to help explain.

    I'll just explain what I'd like done for the example spreadsheet.

    Column A has a list of Customer ID's. Column B also has a list of Customer ID's. ALL of the numbers in Column B should also be in Column A; however, not all of the ID's in A will be in B. Column C has the Number of Orders that the customer had during a month, these numbers correspond with the Customer ID's in Column B. In Column D, I have the name of the customer that corresponds with the ID's in Column A.

    So what I need to do is get the Number of Orders for each of the ID's in Column A (if it has one - again, some of the ID's in Column A won't be listed) and the Number of Orders should be pasted in Column E. If possible, I'd like to also delete Columns B and C once it finishes.

    End result should contain the Customer ID's from Column A, Customer Names from Column D, and Number of Orders from Column C. In my real spreadsheet, the data from previous months is in Columns E-O.
    Attached Files Attached Files

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Align matching columns, then copy and paste data from one cell into another

    the following, copied down from E2, will (i think) give you the answers you want...

    =IFERROR(VLOOKUP(A2,$B$2:$C$8,2,FALSE),"Not Found") - you can change the "Not Found" to whatever you want, or even to just ""

    In order to delete B and C, you will have to copy/paste values ovet that formula i just gave you, once you are finished

    Hope that helps?

  6. #6
    Registered User
    Join Date
    01-03-2013
    Location
    Arkansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Align matching columns, then copy and paste data from one cell into another

    Looks like it works perfectly! Thank you

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Align matching columns, then copy and paste data from one cell into another

    Happy to help and thanks for the rep

+ 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