+ Reply to Thread
Results 1 to 6 of 6

Joins in excel

  1. #1
    Registered User
    Join Date
    03-03-2008
    Posts
    4

    Joins in excel

    Hey guys, I come from a SQL background. I've never really worked with Excel that much. I basically have two tabs in an excel spreadsheet. I need to create a third one which is simply a 'join' between the other two where two fields in one sheet is equivalent to the same two in the other sheet.

    This may be a very elementary question to some of you. Any help would be appreciated.

    Thank you.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    the simplest way is to
    open the new 3rd sheet
    type = in a1 (dont hit cr or enter)
    click tab of your first sheet
    click first cell of column you want to copy
    hit return
    now if you click in new third sheet a1 you will see how excel references sheet 1
    you can just click/drag to fill down.
    repeat for columns from sheet 2

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    where two fields in one sheet is equivalent to the same two in the other sheet
    What exactly do you mean with this? Can you give examples?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    03-03-2008
    Posts
    4
    Perhaps I didn't explain this well enough. Excuse me. I don't want to make a third sheet which is simply a combining of everything in the first two. I only want to bring over rows where certain field values in sheet 1 are equal to those in sheet 2.

    In other words, where sheet1.A1 = sheet2.A1 and sheet1.B1 = sheet2.B2

    I hope this makes a little more sense.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Joins in excel

    You might be able to use MS Query to extract Excel ranges from your
    two wkshts. This works for consolidating data from the active workbook (Just save it first so Excel can find it):

    This example uses 2 named ranges in the current workbook.
    (Each range contain 4 columns: Dept, PartNum, Desc, Price)

    Assumptions:
    The data in each sheet is structured like a table:
    --->Col headings (Dept, PartNum, Desc, Price)
    --->Columns are in the same order.

    The data in each sheet is in named ranges.
    --->I used rngSht1Data and rngSht2Data

    (Note: MS Query may display warnings about it's ability to show the query
    ...ignore them and proceed.)
    Please Login or Register  to view this content.
    Return the data to Excel.

    Once that is done....to get the latest data just:
    Right Click in the data range
    ...<Refresh Data>

    You can edit the query SQL at any time to
    add/remove data sources and/or fields.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  6. #6
    Registered User
    Join Date
    03-03-2008
    Posts
    4
    Actually, I stumbled across an Add-in tool called DigDB while googling. It allows, among others, to do joins across Excel tables. It works perfectly.

    Thanks for all of your help.

+ 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