+ Reply to Thread
Results 1 to 4 of 4

Thread: Formula to merge two worksheets

  1. #1
    Registered User
    Join Date
    02-27-2011
    Location
    Florida
    MS-Off Ver
    Excel 2008 Mac
    Posts
    2

    Formula to merge two worksheets

    I need help writing a formula. I am trying to update one worksheet based on a matching column from another worksheet.

    Worksheet 1: ecEveryoneElse
    The NewUserName column in this worksheet contains the new data. There are 98000 records in this worksheet.
    +---------------+---------------+
    | A             | B             |
    +---------------+---------------+
    | UserName      | NewUserName   |	
    +---------------+---------------+
    | 3282384       |2wsUShrwj45h   |				
    | 2293848       |38Ssjdjr423s   |						
    | 2047765       |2OSIv0s4i348   |
    +---------------+---------------+
    Worksheet 2: llo_studentsdemo
    The myNewID (B) column in this worksheet needs to be updated when id matches UserName from the other worksheet. There are 133000 records in this worksheet. I need to do this for all records in this worksheet. Also, there are several records with matching id values in this worksheet.
    +---------------+---------------+---...
    | A             | B             | C
    +---------------+---------------+---...
    | id            | myNewID       | nextColumn
    +---------------+---------------+---...
    | 3282384       | (value is 2wsUShrwj45h after query runs)
    | 2293848       | (value is 38Ssjdjr423s after query runs)
    | 2047765       | (value is 2OSIv0s4i348 after query runs)
    +---------------+---------------+---...
    Here is what I want to do:

    if ecEveryoneElse.UserName = llo_studentsdemo.id
    set llo_studentsdemo.myNewID = ecEveryoneElse.NewUserName
    end

    Any help writing this formula would be very much appreciated.

    Thank you.

    Mike

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: help writing formula to merge two worksheets

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    02-27-2011
    Location
    Florida
    MS-Off Ver
    Excel 2008 Mac
    Posts
    2

    Re: help writing formula to merge two worksheets

    I attached a workbook that contains the same structure and some dummy data.

    Hope this helps.

    Mike
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: help writing formula to merge two worksheets

    Place this in B2 and drag the formula down
    =IFERROR(VLOOKUP(A2,ecEveryoneElse!$A$2:$B$40,2,0),"Not Found")

+ 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.2.0